Remove the duplicated line present only next to each other with Perl
#!/usr/bin/perl use strict; use warnings; { $_ = ; my $next_line; while( $next_line = ) { #print "current line: $_ -- next line:...ne$/"; print $_ if $_ ne $next_line; } continue { $_ = $next_l...2305 days ago
Extract the values between to user defined string with Perl
#!/usr/bin/perl -w use strict; while () { process_record() if /^\s*START/; } sub process_record { my $line; while...} print "\n"; #a printout spacer for next record } __DAT...XXX ZZZ YYY START These are the second set of lines which are t...2305 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...t if("ggplot2" %in% rownames(installed.packages())){ library(ggplot...import a text file with gene positions # columns should be: chr, positio...2297 days ago
2277 days ago
Download genomes in batch from NCBI
curl 'ftp://ftp.ncbi.nlm.nih.gov/genomes/genbank/bacteria/assembly_summary.txt' | awk '{FS="\t"} !/^#/ {print $20}' | sed -r 's|(ftp://ftp.ncbi.nlm.nih.gov/genomes/all/)(GCA/)([0-9]{3}/)([0-9]{3}/)([0-9]{3}/)(GCA_.+)|\1\2\3\4\5\6/\6_genomic.fna.gz|' > genomic_file2276 days ago
2265 days ago
Perl script to remove fasta sequences in multifasta file with certain length threshold
#!/usr/bin/perl use strict; use warnings; my $minlen = shift or...inlen` parameter not provided\n"; { local $/=">"; while() { chomp; next unless /\w...unk; my $seqlen = length join "", @chunk; print ">$_" if(...2264 days ago
Perl script to convert fastq to fasta file
#!/usr/bin/env perl use strict; use warnings; use Bio::Factory::EMBOSS; my $usage = "perl $0 in....my $outfile = shift or die $usage; my $factory = Bio::Factory::EMBOSS->n...# $seqret is a Bio::Tools::Run::EMBOSSApplication object $seqret->run({...2264 days ago
Plot custom gene density with R
library(karyoploteR) pp2262 days ago
Estimate Genome Size with Jellyfish and R
jellyfish count -t 8 -C -m 19 -s 5G -o 19mer_out --min-qual-char=? /common/Tutorial/Genome_estimation/sample_read_1.fastq /common/Tutorial/Genome_estimati...e used in the run. eg: 1,2,3,..etc. #-C -both-strands...Output file name #--min-quality-char Base quality value...2259 days ago