Postagens

Linha Perl para tirar x bases {50} do começo e do final das sequências - Usei para arquivo xml do BEAST

cat infile.xml | perl -lane ' if ($_=~/^(\s+)[ACGTN-]+/) { my $s=$1; $_=~s/^\s+[ACGTN-]{50}/$s/; $_=~s/[ACGTN-]{50}\s*$//; print $_; } else { print $_; }  '  > infile_modificadomenosN.xml

Forçar instalação de pacote R

sudo R CMD INSTALL [nomedoprograma]

getSRA.sh script

srsilva@ubuntu:/data/sequencing/raw$ more getSRA.sh #!/bin/sh # Sugerido em http://www.ncbi.nlm.nih.gov/books/NBK47527/ # -l (maximum bandwidth of request, try 200M and go up from there) - Megabits/second # -i <private key file> (http://pt.wikipedia.org/wiki/Criptografia_de_chave_p%C3%BAblica) # -r recursive copy # -Q (for adaptive flow control) - needed for disk throttling! (ajustar o fluxo de dados ao gravar no disco) # -T to disable encryption # -k1 enable resume of failed transfers ascp -i ~/.aspera/connect/etc/asperaweb_id_dsa.putty -k1 -QTr -l200m anonftp@ftp-private.ncbi.nlm.nih.gov:/sra/sra-instant/reads/ByStudy/sra/SRP/SRP021/SRP021491/ .

Para contar o número de linhas que conte nucleotideos

perl -lane 'print $_ if ($.%4==2);' [nome do arquivo.fastq] | wc -l

Merge de reads x lncRNAs no R

system("pwd") HCLnc <-read.delim(file="/work/srsilva/AssemblyUvul.HCLnclist.out",stringsAsFactors=FALSE) HCLnc <-read.delim(file="/work/srsilva/Assembly/Uvul.HCLnclist.out",stringsAsFactors=FALSE) HCLnc <-read.delim(file="/work/srsilva/Assembly/HCLnc/Uvul.HCLnclist.out",stringsAsFactors=FALSE) colnames(HCLnc) <- c('IDreads') concatena <-merge(x=readsvsmontagem, y=HCLnc, by='IDreads' ) concatena dim(concatena) /U_vulgaris/Assemb/DBBwtUvulgaris/Uvul-counts.txt", stringsAsFactors=FALSE, header=FALSE) colnames(readsvsmontagem) <-c('IDreads','count') colnames(HCLnc) <- c('IDreads') concatena <-merge(x=readsvsmontagem, y=HCLnc, by='IDreads') dim(concatena) dim(HCLnc) dim(readsvsmontagem) sel <- c("isotig38248","isotig32047","isotig38212","isotig35263","isotig40992","isotig02091","isotig02090","isotig...

Usando o merge no R

> matchesfolhas <-read.delim(file="folha-rRNA.sam.ids", header=FALSE, stringsAsFactors=FALSE) > colnames(matchesfolhas) <- c('IDread','IDsilva') > silvaclass <- read.delim(file="../../../tmp/SILVA_119.txt", header=FALSE, stringsAsFactors=FALSE) > colnames(silvaclass) <- c('IDsilva','IDclass') > res <- merge(x=matchesfolhas, y=silvaclass, by='IDsilva') Para procurar vetor de strings subset(res,IDclass %in% outralistaqualquer)

extraindo lista de arquivos fasta

extraindo lista de arquivos fasta grep '>' Pvulgaris.Lnc.out-1438107679-HighConfidencelncRNA.fa | sed 's/>//' |