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$/"; print $_ if $_ ne $next_line;...2289 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 (def...{ print "$line" } print "\n"; #a printout spacer...e extracted? END XXX ZZZ YYY START These are the second set o...2289 days ago
Plot the density of genes in R
#column1 = chromosome name and column2 = start position of the gene # check if ggplot2 is...if not, install and load it if("ggplot2" %in% rownames(installed.packages()))...lse { install.packages("ggplot2") library(ggplot2) } # import a...2281 days ago
2261 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_file2260 days ago
2249 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 $/...s/>$//gs; my @chunk = split /\n/; my $header = shift @chunk; my $...2248 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 = shift or die $usage; my $outfile = sh...:EMBOSS->new; my $seqret = $factory->program('seqret'); # $seqret is a B...2248 days ago
Plot custom gene density with R
library(karyoploteR) pp2246 days ago
Estimate Genome Size with Jellyfish and R
...fish count -t 8 -C -m 19 -s 5G -o 19mer_out --min-qual-char=? /common/Tutorial/Genome_estimation/sample_read_1.fastq /common/Tutorial/G...-t -treads=unit32 Number of treads to be used in the run. eg...memory allocation #-o -output=string Output file name #-...2243 days ago