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 script1649 days ago
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; $i1601 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
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
1591 days ago