Check overlapping range with Perl
#!/usr/bin/perl use strict; use warnings; my @ranges = 0; push @ranges, $ranges[-1] + 1 + int rand 200 for 1..10000; my @tests = map int rand $ranges[-1], 0....2684 days ago
Extracting FASTA sequences based on position with perl script !!
#!/usr/bin/env perl #Uses: perl sub-seq.pl input.txt range use strict; use warnings; my $end = pop; my $start = pop; local $/ = '>'; while () {...2678 days ago
Extract ids from file with perl
#!/usr/bin/perl use strict; use warnings; my $fh=read_fh("fin.txt"); my %idHash; my $lastKey; while () { chomp $_; my @cells = split /\t/, $_; $idHash{$cells[0]}=$....2665 days ago
Extract fasta sequence from a multifasta file with coordinates
#!/usr/bin/perl use Bio::DB::Fasta; #USAGE perl extractFASTAwithSIZE.pl finalSample_filtered.fa 0 1000 > aaaaaa.fa my $fastaFile = shift; my $querySizeST = shift; my $qu...2589 days ago
Download the genome from NCBI using bash script/command
...do echo "Processing $f file..." filename=$(basename "$f") extension="${filename##*.}" filename="${filename%.*}" # Create a directory with appending G mkdir "G$file...2589 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 }2582 days ago
Download the gff files from NCBI using bash script/command
...do echo "Processing $f file..." filename=$(basename "$f") extension="${filename##*.}" filename="${filename%.*}" # Create a directory with appending G mkdir "GFF$fi...2580 days ago
Extract fasta sequence from a multifasta file with fasta header Ids
...$select{$_} = 1; } close LIST; $/ = "\n>"; open OUT, ">$out" or die; open FASTA, "$fasta" or die; while () { s/>//g; my ($id) = split (/\n/, $_); print OUT ">...2575 days ago
2551 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; $aa2572 days ago