Extract ids from file with perl
#!/usr/bin/perl use strict; use warnings; my $fh=read_fh("fin.txt"); my %idHash; my $lastKey; while (...ete the last id for secutiry -- might does not finish all steps delete $...##################################### #Open and Read a file sub read_fh...2660 days ago
picard tools command to get some insert statistics
#picard tools to get some insert statistics to see whether our reads seem to be in the correct place #module load picard/2.0.1 java -Xmx16g -XX:PermSize=8g -jar $PICARD_HOME/picard.jar CollectInsertSizeMetrics MINIMUM_PCT=0...1388 days ago
Extract fasta sequence from a multifasta file with coordinates
#!/usr/bin/perl use Bio::DB::Fasta;...; my $db = Bio::DB::Fasta->new( $fastaFile ); my @ids = $...my $id (@ids) { my $sequence = $db->seq($id, $querySizeS...0_000 => 4_000_000); my $length = $db->length('CHROMOSOM...Tied hash access tie %sequences,'Bio::DB::Fasta','/path/to...2584 days ago
Download the genome from NCBI using bash script/command
#!/bin/bash # Download the genome from NCBI using command...$20} ' | sed -r 's|(ftp://ftp.ncbi.nlm.nih.gov/genomes/all/.+...t' | awk '{FS="\t"} !/^#/ {print $20} ' | sed -r 's|(ftp://ft...sion="${filename##*.}" filename="${filename%.*}" # Crea...2583 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$ ]]; then awk ' /^>/ && FNR > 1 {next} {print $0} ' $f |...s not right file" fi #cat $f done2582 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 }2576 days ago
Download the gff files from NCBI using bash script/command
#!/bin/bash # Download the genome from NCBI using command...t' | awk '{FS="\t"} !/^#/ {print $20} ' | sed -r 's|(ftp://ft...for protozoa curl 'ftp://ftp.ncbi.nlm.nih.gov/genomes/refseq...#Read the uerl from file and download FILES=$(pwd)/*...2574 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 @AR...RGV; my $out = shift @ARGV; my %select; open LIST, "$list" or die; while...$select{$_} = 1; } close LIST; $/ = "\n>"; open OUT, ">$out" or die;...2569 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; $aa2566 days ago