Extract ids from file with perl
#!/usr/bin/perl use strict; use warnings; my $fh=read_fh("fin....my %idHash; my $lastKey; while () { chomp $_; my @cells = split /\t/, $_; $idHash{$cells[0]}=$.; push @allIds,...) { open $filehandle, "gunzip -dc $filename |" or die $!;...2607 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 CollectIns...1336 days ago
Extract fasta sequence from a multifasta file with coordinates
...>get_all_primary_ids; foreach my $id (@ids) { my $seq...); if (!defined( $sequence )) { die "Seque...; my $revseq = $db->seq('CHROMOSOME_I', 4_100_000 => 4_0...stuff } # Tied hash access tie %sequences,'Bio::D...2531 days ago
Download the genome from NCBI using bash script/command
...# Download the genome from NCBI using command # Create a Directory mkdir genome cd genome # Look for genome...20} ' | sed -r 's|(ftp://ftp.ncbi.nlm.nih.gov/genomes/all/.+/...n # -for vertebrate_other curl 'ftp://ftp.ncbi.nlm.nih.go...2531 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...^>/{s/ /_/g}' > $f.fa #then sed '1!{/^\>/d;}' $f > $f.fa else echo "this file is not right fil...2530 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 }2524 days ago
Download the gff files from NCBI using bash script/command
...# Download the genome from NCBI using command # Create a Directory mkdir genome_gff cd genome_gff # Look for gen...20} ' | sed -r 's|(ftp://ftp.ncbi.nlm.nih.gov/genomes/all/.+/...n # -for vertebrate_other curl 'ftp://ftp.ncbi.nlm.nih.go...2522 days ago
Extract fasta sequence from a multifasta file with fasta header Ids
#!/usr/bin/perl use strict; use warnings; #Usage: perl m...@ARGV; my $out = shift @ARGV; my %select; open LIST, "$list" or die; while () { chomp; s/>//g; $selec...); print OUT ">$_" if (defined $select{$id}); } close FASTA; clo...2517 days ago
2493 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; $aa2514 days ago