Results for "R"

Bio-Scripts

  • Find and replace in multifasta or fasta header with perl onliner

    You have a fasta file and you want to replace: "|" You are told to replace that by "_" perl -i -p -e "s/\|/_/g" genome.fasta -i = inplace editing -p = loop over lines and print each line (after processing) -e = command line script

    1649 days ago

  • QV calculation in Bash !

    ...mtools NUM_BP=`samtools depth $2 | perl -e '$c = 0; while(){chomp; @s = split(/\t/); if(scalar(@s) >= 3){$c++;}} print "$c\n...awk -F "\t" '{if (!match($NF, "0/1")) print $1"\t"$2"\t"$3"\t"$4"\t"$5...t SUM}'` echo "num snp: "$NUM_SNP perl -e 'chomp(@ARGV); $ns = $ARG...

    1638 days ago

  • Samtools commands for bioinformatician !

    ...apping_file.bam ### converting sam file into fasta samtools fasta reads_mapped.sam > reads.fasta...sal_sej.bam | less ### sort reads by flag specified and...-v : output only potential variants bcftools view -c -v sal...mapped. samtools flagstat sorted_dupremoved.bam > flagstat....

    1637 days ago

  • Perl subroutine to creating kmer !

    sub k_mers { my ($sequence, $k) = @_; my $len = length($sequence); my @result = (); for (my $i = 0; $i

    1601 days ago

  • Perl script to remove duplicated lines !

    #!/usr/bin/perl use strict; use warnings; { $_ = ; my $next_line; while( $next_line = ) { #print "current line: $_ -- next line: $next_line$/"; print $_ if $_ ne $next_line;...

    1594 days ago

  • Bash script to download SRA file !

    #We can use the sratoolkit to directly pull the sequence data (in paired FASTQ format) from the archive. fastq-dump is in the SRA toolkit. It allows directly dow...mp --split-files SRR1770413 #SRA stores data in a particular...ensures we get two files, one for the first and second mate in...

    1593 days ago

  • Bash script to alignment of short reads against reference genome !

    bwa mem -t 40 -R '@RG\tID:K12\tSM:K12' \ E.coli_K12_MG1655.fa SRR1770413_1.fastq.gz SRR1770413...ed.bam SRR1770413.bam ##Breaking it down by line: #al...FASTQs E.coli_K12_MG1655.fa SRR1770413_1.fastq.gz SRR1770413...t to .sorted.bam. #marking PCR duplicates: sambamba markdup...

    1593 days ago

  • Perl6 script to count ATGC !

    use v6; my $default-input = "AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC"; sub MAIN($input = $default-input) { "{.map({ +$input.comb(/$_/) })}".say; } #I love perl v6

    1593 days ago

  • Install Samtools, Bcftools and htslib on Ubuntu !

    #Inspired from online search sudo apt-get update sudo apt-get...ib1g-dev sudo apt-get install libncurses5-dev sudo apt-get instal...apt-get install liblzma-dev cd /usr/bin wget https://github.com/....9.tar.bz2 tar -vxjf samtools-1.9.tar.bz2 cd samtools-1.9 make...

    1592 days ago

  • Perl subroutine for Kmer !

    sub kmers { my $seq = shift or return; my $len = length $seq; my @kmers; for (my $i = 0; ($i + $KMER_SIZE)

    1591 days ago