Check overlapping range with Perl
...s) = @_; if (@$ranges == 1) { if (@$tests) { print "tests in range $ranges->[0]:...\n", join(", ", @$tests), "\n"; } else { print "range $ranges->[0] is empty\...2641 days ago
Extract fasta sequence from a multifasta file with coordinates
...nce )) { die "Sequence $seq not found. \n" } print ">$id\n", "$sequence\n"; }...h access tie %sequences,'Bio::DB::Fasta','/path/to/fasta/files/'; print $sequences{'CHROMOSOME_I:1,20...2546 days ago
Download the genome from NCBI using bash script/command
...mmary.txt' | awk '{FS="\t"} !/^#/ {print $20} ' | sed -r 's|(ftp://ftp...mmary.txt' | awk '{FS="\t"} !/^#/ {print $20} ' | sed -r 's|(ftp://ftp...mmary.txt' | awk '{FS="\t"} !/^#/ {print $20} ' | sed -r 's|(ftp://ftp...mmary.txt' | awk '{FS="\t"} !/^#/ {print $20} ' | sed -r 's|(ftp://ftp...2546 days ago
Unzip all the genome file and remove all fasta header except first one
...zip -d *.gz FILES=$(pwd)/* for f in $FILES do echo "Processing $f file..." if [[ $f =~ \.fna$ ]]; then awk ' /^>/ && FNR > 1 {next} {print $0} ' $f | sed '/^>/{s/ /_/g}...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
...mmary.txt' | awk '{FS="\t"} !/^#/ {print $20} ' | sed -r 's|(ftp://ftp...mmary.txt' | awk '{FS="\t"} !/^#/ {print $20} ' | sed -r 's|(ftp://ftp...mmary.txt' | awk '{FS="\t"} !/^#/ {print $20} ' | sed -r 's|(ftp://ftp...mmary.txt' | awk '{FS="\t"} !/^#/ {print $20} ' | sed -r 's|(ftp://ftp...2537 days ago
Extract fasta sequence from a multifasta file with fasta header Ids
...lose LIST; $/ = "\n>"; open OUT, ">$out" or die; open FASTA, "$fasta" or die; while () { s/>//g; my ($id) = split (/\n/, $_); print OUT ">$_" if (defined $select...2532 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; $aa2529 days ago
2527 days ago
Calculate Dinucleotide Frequency with Perl
#!/usr/bin/perl -w use strict; my ($genome, $head, $tail); my (%mono_nt, %di_nt); $/ = ">"; open my $fasta, '2352 days ago