Skip to content

Instantly share code, notes, and snippets.

Avatar
😶
I hate people.

Pierre Lindenbaum lindenb

😶
I hate people.
View GitHub Profile
@lindenb
lindenb / biostars9550377.nf
Last active January 6, 2023 18:05
biostars9550377 "speeding up bcftools view"
View biostars9550377.nf
/* author Pierre Lindenbaum */
params.vcfs="NO_FILE"
params.samples="NO_FILE"
workflow {
each_vcf = Channel.fromPath(params.vcfs).splitText().map{it.trim()}
c2vcf = CHROMS_IN_VCF(each_vcf)
View README.md

with include{MyTest}

Cannot find a component with name 'MyTest' in module: .../20230103.nf.class/./class.nf

 -- Check script 'test.nf' at line: 2 or see '.nextflow.log' file for more details

without include{MyTest}

@lindenb
lindenb / Makefile
Created September 22, 2022 19:33
biostar9539326.c proper way to alter bgzf-compressed fastq files using htslib, multithreaded
View Makefile
CC?=gcc
ifeq ($(HTSLIB),)
$(error undefined $$HTSLIB)
endif
CFLAGS= -Wall -O3 -I$(HTSLIB)
LDFLAGS= -L$(HTSLIB) -lz -lhts
@lindenb
lindenb / Biostar9532375.java
Created July 26, 2022 21:38
Biostar9532375 Remove redundant nucleotide sequences in a FASTA file containing ambiguous N
View Biostar9532375.java
import java.io.*;
import java.util.*;
public class Biostar9532375 {
private static class Sequence {
String name;
StringBuilder seq=new StringBuilder();
boolean same(char c1,char c2) {
if(c1==c2) return true;
if(c1=='N' || c2=='N') return true;
return false;
@lindenb
lindenb / biostar9528296.c
Last active June 23, 2022 07:35
https://www.biostars.org/p/9528296/ How to search the human genome for sequences that differ from a given sequence by a set number of mismatches? C
View biostar9528296.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#define MAX_SEQ_LENGTH 100
static char compl(char c) {
switch(c) {
case 'A': return 'T';
@lindenb
lindenb / Usage.md
Created June 11, 2022 12:49
https://www.biostars.org/p/9526679/ How to merge 20K single-sample VCFs *without* using plink or plink2? #bcftools #nextflow
View Usage.md

Usage

find path/to/dir -type f -name "S*.vcf.gz" > jeter.list
nextflow run --vcfs ${PWD}/jeter.list biostar9526718.nf

add -C config.cfg toconfigure your cluster config....

@lindenb
lindenb / biostar9524046.nf
Created May 21, 2022 14:26
biostar9524046.nf https://www.biostars.org/p/9524046/ Forum:Compare the samples in a VCF concordance picard
View biostar9524046.nf
nextflow.enable.dsl=2
params.vcf=""
workflow {
picard = downloadPicard()
samples_ch = vcf2samples(params.vcf).splitCsv(header: false,sep:'\t',strip:true)
pair_ch = samples_ch.combine(samples_ch).filter{T->!T[1].equals(T[3])}
concordances_ch = concordance(picard,pair_ch)
@lindenb
lindenb / biostar9523782.nf
Last active May 19, 2022 16:28
https://www.biostars.org/p/9523782/ blast biostar nextflow fasta sequence align
View biostar9523782.nf
nextflow.enable.dsl=2
/* full path to query directory */
params.qdir="/DIR1"
/* full path to target/database directory */
params.tdir="/DIR2"
workflow {
View release.sh
#!/bin/bash
# https://github.community/t/how-to-create-full-release-from-command-line-not-just-a-tag/916/2
if [ "$#" -ne 2 ]; then
echo "Expected: 'version' 'message'"
exit -1
fi