This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# | |
# 2019, Peter Menzel, Labor Berlin | |
# This script converts the Kraken output format into | |
# a 3-column output format with columns: | |
# 1: read name | |
# 2: taxon id | |
# 3: score, which is defined as the fraction of k-mers having that taxon id and its ancestors over all k-mers | |
# | |
# use as input for ktImportTaxonomy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# make-igv-genome-json.pl | |
# Peter Menzel | |
# | |
# This script creates an IGV genome json file (https://github.com/igvteam/igv/wiki/JSON-Genome-Format) | |
# The arguments are the paths to fasta, fai and gff files. | |
# | |
# Example usage: | |
# datasets download genome accession GCF_002101575.1 | |
# unzip ncbi_dataset.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=========================== | |
Days 10 ... | |
=========================== | |
see https://github.com/pmenzel/advent-of-code/tree/master/2022 | |
=========================== | |
Day 9 | |
=========================== | |
Part 1: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# | |
# rotates and (if necessary reverse complements) an assembly of a circular genome | |
# so that it starts with the sequence having the best blast hit to a gene database, | |
# e.g. dnaA | |
# | |
# depends on blastn being installed | |
# | |
# Example usage: | |
# rotate_assembly.pl assembly.fasta dnaA.fa > rotated_assembly.fa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $cigar = "30M40D50M"; | |
my $n_soft = 71; | |
my $out_cigar = ""; | |
# there are already at least $n_soft soft-clipped bases at the end of the CIGAR | |
# then do nothing | |
if($cigar =~ m/(\d+)S$/ and $1 >= $n_soft) { | |
$out_cigar = $cigar; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* lca.cpp, 2018, Peter Menzel | |
1. Download https://github.com/bioinformatics-centre/kaiju/ and compile | |
2. Copy lca.cpp to kaiju/src | |
3. Compile lca.cpp with: | |
g++ -O3 -std=c++11 -I./include/ncbi-blast+ -o lca lca.cpp Config.o util.o bwt/bwt.o bwt/compactfmi.o bwt/sequence.o bwt/suffixArray.o include/ncbi-blast+/algo/blast/core/blast_seg.o include/ncbi-blast+/algo/blast/core/blast_util.o include/ncbi-blast+/algo/blast/core/blast_filter.o include/ncbi-blast+/algo/blast/core/ncbi_std.o include/ncbi-blast+/algo/blast/core/blast_program.o include/ncbi-blast+/algo/blast/core/blast_encoding.o include/ncbi-blast+/algo/blast/core/blast_query_info.o include/ncbi-blast+/algo/blast/core/blast_stat.o include/ncbi-blast+/algo/blast/core/blast_options.o include/ncbi-blast+/algo/blast/core/blast_message.o include/ncbi-blast+/algo/blast/core/ncbi_math.o include/ncbi-blast+/algo/blast/core/pattern.o include/ncbi-blast+/algo/blast/core/blast_psi_priv.o include/ncbi-blast+/algo/blast/core/blast_dynarray.o include/ncbi-blast+/algo |