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: $next_line$/";...$_ ne $next_line; } continue { $_ = $next_line; } print $_ if eo...2345 days ago
Extract the values between to user defined string with Perl
#!/usr/bin/perl -w use strict; while () { process...\s*START/; } sub process_record { my $line; while (defined ($line = ) and $line !~ /^\...XXXX YYYY START These are the first set of lines which are to be extracted...2345 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" %in% rownames(installed.packages(...# import a text file with gene positions # columns should be: chr, p...2336 days ago
2316 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_file2315 days ago
2304 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 die "Error: `minlen` parameter not provided\n"; { local $/=">"; while() { chom...next unless /\w/; s/>$//gs; my @chunk = split /\n/; my $h...2303 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.fq out.fa"; my $infile = sh...$usage; my $factory = Bio::Factory::EMBOSS->new; my $seqret = $factory->p...2303 days ago
Plot custom gene density with R
library(karyoploteR) pp2302 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_estimation/sample_read_2.fastq #-t...-C -both-strands Count both strands #-m -mer-len=unit32...2298 days ago