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 $_;...$_; $idHash{$cells[0]}=$.; push @allIds, $cells[0]; } #Delet...############################### #Open and Read a file sub read_fh {...2637 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 $PI...rd.jar CollectInsertSizeMetrics MINIMUM_PCT=0 HISTOGRAM_FILE=.pdf INPUT= OUTPUT=.s...1365 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 > a...shift; my $db = Bio::DB::Fasta->new( $fastaFile ); my @i...} __END__ use Bio::DB::Fasta; # Create database fr...gth('CHROMOSOME_I'); my $header = $db->header('CHROMOSOM...2561 days ago
Download the genome from NCBI using bash script/command
#!/bin/bash # Download the genome from NCBI using command # Create a Directory mk...curl # Commentline if you are not interested in that geno...+/)(GCF_.+)|\1\2/\2_genomic.fna.gz|' > genomic_file_plant.../ftp.ncbi.nlm.nih.gov/genomes/all/.+/)(GCF_.+)|\1\2/\2_genomi...2560 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 $FI...echo "Processing $f file..." if [[ $f =~ \.fna$ ]]; then awk ' /^>/ && FNR > 1 {next} {p...e echo "this file is not right file" fi #cat $f done2559 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 }2553 days ago
Download the gff files from NCBI using bash script/command
#!/bin/bash # Download the genome from NCBI using command # Create a Directory mk...curl # Commentline if you are not interested in that geno...genomic_file_plant # -for archaea curl 'ftp://ftp.ncbi.n...ff.gz|' > genomic_file_vertebrate_other # -for invertebrat...2551 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 %sele...ose LIST; $/ = "\n>"; open OUT, ">$out" or die; open FASTA, "$fasta" or die; while (...2547 days ago
2523 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; $aa2543 days ago