Skip to content

Instantly share code, notes, and snippets.

View lindenb's full-sized avatar
😶
I hate people.

Pierre Lindenbaum lindenb

😶
I hate people.
View GitHub Profile
@lindenb
lindenb / README.md
Created August 7, 2019 12:32
ideas for some new nextflow operators (would require htsjdk lib) . was : https://twitter.com/PaoloDiTommaso/status/1159073940448432129
@lindenb
lindenb / coverage.nf
Last active June 17, 2019 14:43
draw coverage using nextflow
bedIn = file( params.bed )
reference = file( params.reference )
bamChannel = Channel.fromPath( params.bams ).
splitCsv(header: false,sep:',',strip:true).
map{T->T[0]}
String jvarkit(String tool) {
return "/path/to/jvarkit-git/dist/"+tool+".jar";
}
@lindenb
lindenb / bcftools-gvf.nf
Created May 23, 2019 10:11
calling bams in gvcf mode with bcftools nextflow
reference=file("${params.reference}")
bams=file("${params.bams}")
process getChromosomes {
tag "get chromosomes from ${ref}"
executor 'local'
input:
file ref from reference
output:
@lindenb
lindenb / biostar379454.c
Last active September 9, 2019 14:24
ode golf: detecting homopolymers of length N in the (human) genome. C biostar repeat
/**
https://www.biostars.org/p/379454/#379505
Code golf: detecting homopolymers of length N in the (human) genome
Author: Pierre Lindenbaum
compilation:
gcc -O3 -Wall -o biostar379454 biostar379454.c
wget -O - -q "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&rettype=gb&retmode=xml&id=NZ_AOLM01000025"   | xsltproc --novalid biostar378467.xsl - > out.tsv
import java.net.*;
import java.util.*;
import java.io.*;
import org.w3c.dom.*;
import javax.xml.xpath.*;
import javax.xml.parsers.*;
public class Biostar376339 {
public static void main(final String args[]) {
try {
String urlstr="https://www.uniprot.org/uniprot/P0AD86.xml";
@lindenb
lindenb / hg19.config
Last active April 23, 2019 17:32
Resources from UCSC. jvarkit ucsc config biwig bigbed
url: http://hgdownload.soe.ucsc.edu/hubs/gtexAnalysis/hg19/gtexAwgAseCombined.bb
description: Allele-Specific Expression Combined Sites from GTEx Analysis
name: GTExASCombined
@lindenb
lindenb / highcov.c
Created April 19, 2019 14:36
calculates mean bam coverage and prints a bed of the regions covered more than FACTOR*(mean-coverage) : htslib sam bam coverage depth mask
/**
Author: Pierre Lindenbaum PhD. 2019
This tools calculate the mean depth of a bam (ignoring the non-covered bases)
and output a BED file of the regions covered more than mean-depth*FACTOR
compilation: gcc -o a.out -O3 -Wall -I../htslib highcov.c -L../htslib -lm -lpthread -lhts -lz -llzma -lbz2
*/
@lindenb
lindenb / biostar375624.nf
Last active April 18, 2019 15:28
biostar 375624 https://www.biostars.org/p/375624/ "How to merge multiple fastq file using table?" nextflow fastq
process mergeFastq {
tag "merging ${sample}"
input:
set sample,fastqs from Channel.fromPath(params.input).splitCsv(header:false,sep:'\t',skip:1).groupTuple(by:0)
output:
file("${sample}.fastq")
script:
"""
@lindenb
lindenb / discordant.c
Created April 12, 2019 07:26
C program finding discordant reads. htslib sam bam read sv structural variant
/**
Pierre Lindenbaum, 2019
gcc -o a.out -O3 -Wall -Isamtools/include discordant.c -Lsamtools/lib -lhts
*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>