Extract ids from file with perl
...{$allIds[-1]}; next if exists $hash{$look_for}; ############################################################ #Open and Read a file sub read_fh { my $filename = shift @_; my $file...2622 days ago
Extract fasta sequence from a multifasta file with coordinates
....fa 0 1000 > aaaaaa.fa my $fastaFile = shift; my $querySizeST = s...y $db = Bio::DB::Fasta->new( $fastaFile ); my @ids = $db->get_all_pr...database from a directory of Fasta files my $db = Bio::DB::F...Bio::PrimarySeqI stuff } # Filehandle access my $fh = Bio:...2546 days ago
Download the genome from NCBI using bash script/command
...need to provide the right summary file to curl # Commentline if y...\1\2/\2_genomic.fna.gz|' > genomic_file_fungi # -for bacteria cur...\1\2/\2_genomic.fna.gz|' > genomic_file_bacteria # -for plant cu...\1\2/\2_genomic.fna.gz|' > genomic_file_protozoa # -for vertebrate...2546 days ago
Unzip all the genome file and remove all fasta header except first one
#!/bin/bash gzip -d *.gz FILES=$(pwd)/* for f in $FILES do echo "Processing $f file..." if [[ $f =~ \.fna$ ]];...$f.fa #then sed '1!{/^\>/d;}' $f > $f.fa else echo "this file is not right file" fi...2545 days ago
Read a tab delimited file and search with perl
use strict; use warnings; use Data::Dumper; use Text::CSV; use IO::Handle; my $file = "/home/urbe/Tools/Alienomics_v0.1/Alienomics/output/intermediate_files/rRNA/refGene.megablast"; open my $fh, "[0]\n"; warn Dumper $row; # To see the structure }2539 days ago
Download the gff files from NCBI using bash script/command
...need to provide the right summary file to curl # Commentline if y...\1\2/\2_genomic.gff.gz|' > genomic_file_fungi # -for bacteria cur...\1\2/\2_genomic.gff.gz|' > genomic_file_bacteria # -for plant cu...\1\2/\2_genomic.gff.gz|' > genomic_file_vertebrate_mammalian # -fo...2537 days ago
Extract fasta sequence from a multifasta file with fasta header Ids
#!/usr/bin/perl use strict; use warnings; #Usage: perl my $list = shift @ARGV; my $fasta = shift @ARGV; my $out = shift @ARGV; my %select; open LIST...2532 days ago
2508 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);2480 days ago
Convert newline formated sequence into fasta format with perl
use strict; use warnings; my $filename = $ARGV[0]; open(my $fh, '2384 days ago