Download the gff files from NCBI using bash script/command
...t summary file to curl # Commentline if you are not interested in that genome set #....txt' | awk '{FS="\t"} !/^#/ {print $20} ' | sed -r 's|(ftp://ftp....txt' | awk '{FS="\t"} !/^#/ {print $20} ' | sed -r 's|(ftp://ftp...tion on each file. $f store current file name head -n 4 $f > $...2575 days ago
Extract fasta sequence from a multifasta file with fasta header Ids
...ose LIST; $/ = "\n>"; open OUT, ">$out" or die; open FASTA, "$fasta" or die; while () { s/>//g; my ($id) = split (/\n/, $_); print OUT ">$_" if (defined $select...2570 days ago
2546 days ago
Compress and decompress the sequence with perl
use strict; use warnings; my @char; while () { @char = split //; } comp(\@char); #--------------------- my $com= "r0a3m4a4j0"; my @com = split //, $com; dcomp (\@com); #dcomp sub here sub dcomp { my ($com_ref)=@_; my @com=@$com_ref; my $car; for (my $aa=0; $aa2567 days ago
2564 days ago
2521 days ago
Extract the fastq sequence with range in Perl
use Bio::DB::Fasta; open(POSITIONS,"positions.txt"); while(){ chomp; my ($seqName,$begin,$end) = split(/\s/); my $db = Bio::DB::Fasta->new('allGenomeContacted.fa'); my $seq = $db->seq("$seqName", $begin => $end); print "$seq\n"; } close(POSITIONS);2520 days ago
Count the number of N in fasta file with Perl
#!/usr/bin/perl my ($h, $n, $l); open(I,$ARGV[0]) or die($!); while(){ chomp; if(/^>/){ $h=substr($_,1); }else{ $n=($_=~tr/nN/nN/); $l=length($_); print $h,"\t",$l,"\t",$n,"\t",$n/($l-$n),"\n"; } } close(I);2518 days ago
2518 days ago
Collision free write with Perl
#Write into outfile -- collision free because of multicore usesage sub collision_free_wr...$]: open: $!"; flock $ofh, LOCK_EX or die "$0 [$$]: flock: $!"; print $ofh "$msg\n" or die "$...2513 days ago