Calculate ATGC percentage in parallel with perl
#!/usr/bin/perl use strict; use Parallel::ForkManager; use Bio::SeqIO; #usage: perl testParallel.pl my %sequences; my $seqio = Bio::SeqIO->new(-file => "$ARG...2654 days ago
Insert the sequence at desire location in multi-fasta file with Perl
#!/usr/bin/perl use warnings; use strict; use Bio::SeqIO; use Bio::Seq; use File::Copy; #ARGV[0] should be in following format --- Keep the coordinate sorted by...2312 days ago
Perl script to read multi fasta sequence one by one
#!/usr/bin/env perl use strict; use warnings; #USAGE #perl rohanRun.pl seq.fa my $outfile='tmp.fa'; my $fastaSeq_ref = readfasta ("$ARGV[0]"); my %fastaSeq = %...2219 days ago
2125 days ago
Onliner to split the multifasta to singlefasta files !
#Split the multifasta to singlefasta # Multi fasta #Single fasta awk '$0 ~ "^>" { match($1, /^>([^:]+)/, id); filename=id[1]} {print >> filename".fa"}' sequence.fasta1399 days ago
Bash script to handle Multifasta files
#Convert all lowercase residues to uppercase in a FASTA sequence file $ awk 'BEGIN{FS=" "}{if(!/>/){print toupper($0)}else{print $1}}' input.fasta > output.fasta #R...1355 days ago
Onliner to convert multi line fasta to single line fasta !
#Oneliner to convert awk '/^>/ {printf("\n%s\n",$0);next; } { printf("%s",$0);} END {printf("\n");}' < file.fa > fileres.fa #Then delete the first empty line tail -n +2 fileres.fa > fileout.fa926 days ago
Bash script to split multifasta file !
#Using awk, we can easily split a file (multi.fa) into chunks of size N (here, N=500), by using the following one-liner: awk 'BEGIN {n=0;} /^>/ {if(n%500==0){file=spri...821 days ago
Python script to convert Multi-line Fasta to Single-line Fasta
def multi_to_single_line_fasta(input_filename, output_filename): try: with open(input_filename, 'r') as input_file: with open(output_filename,...93 days ago
Perl script to convert Multi-line Fasta to Single-line Fasta !
#!/usr/bin/perl use strict; use warnings; sub multi_to_single_line_fasta { my ($input_filename, $output_filename) = @_; open my $input_file, '', $outpu...93 days ago