Count the number of N in fasta file with Perl
#!/usr/bin/perl my ($h, $n, $l); open(I,$ARGV[0]) or die($!); while(){ chomp; if(/^>/){ $h=substr($_,1); }else{ $n=($_=~tr/nN/nN/); $l=length($_); print $h,"\t",$l,"\t",$n,"\t",$n/($l-$n),"\n"; } } close(I);2480 days ago
Genetic Algorithms demonstration with word DNA in Perl
...y $id (1 .. $pop_size) { # insert an anonymous hash reference in the population array # with the individual's data # the DNA is a random number my $random_dna = 0; for...2386 days ago
Create genome scaffolding with Perl
...or query sequences "prefix" => "psl_scaffold_", # prefix for contig names "pid" => 90, # percent ID threshold "trimlimit" => 50, # max number of overlapping bases outside...2322 days ago
Plot the density of genes in R
#column1 = chromosome name and column2 = start position of the gene # check if ggplot2 is installed, if so, load it, # if not, install and load it if("ggplot2" %i...2298 days ago
2278 days ago
Estimate Genome Size with Jellyfish and R
...har=? /common/Tutorial/Genome_estimation/sample_read_1.fastq /common/Tutorial/Genome_estimation/sample_read_2.fastq #-t -treads=unit32 Number of treads to be used in the r...2260 days ago
Perl script to count the number of files in a directory with regex
#!/usr/bin/perl use strict; use warnings; my @allNames=("_D14_","_B14_","_B15_","_C1T1_","_C3T3_","_D12_","_D13_","_E1B1_","_E1B3_","_H001_","_H3-03_","_H3-04_","_HB...2251 days ago
2224 days ago
Perl script to find coding regions in DNA sequences
...!/usr/bin/perl -w use strict; # if the number of input arguments is lower t...xpression # A group of letters and a decimal number ($codon,$freq) = ($line...logs to manage calculations involving # small numbers between 0 and 1. Log of the...2169 days ago
Perl script to count number of Ns in a multifasta file !
#!/usr/bin/perl my ($h, $n, $l); open(I,$ARGV[0]) or die($!); while(){ chomp; next if /^$/; if(/^>/){ $h=substr($_,1); }else{ $n=($_=~tr/nN/n...2158 days ago