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 => "$...2655 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...2313 days ago
Perl script to read multi fasta sequence one by one
...$fastaSeq{$key}\n"; } sub readfasta { (my $file)=@_; my %sequence; my $header; my $temp_seq; #suppose fasta files contains multiple sequences; open (IN,...2220 days ago
2126 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
...of headers in a FASTA file $ awk '{if ($0 ~/_/) {printf ">";} print $0; }' input.fasta > output.fasta #Match FASTA headers in two different multi-FASTA files $ awk 'NR=FNR{...1356 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.fa927 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=5...int >> file; n++; next;} { print >> file; }' < multi.fa #OR awk -v chunksize...int >> file; n++; next;} { print >> file; }' < multi.fasta #Another great solut...822 days ago
Python script to convert Multi-line Fasta to Single-line Fasta
def multi_to_single_line_fasta(input_filename, output_filename): try:...nt(f"Error: File '{input_filename}' not found.") # Example usage: # multi_to_single_line_fasta('multi_line.fasta', 'single_line.fas...94 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,...put_filename in single-line FASTA format.\n"; } # Example usage: # multi_to_single_line_fasta('multi_l...94 days ago