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 / tmp.c
Created March 25, 2019 16:34
bam x11
#include <X11/Xlib.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
#include <iostream>
#include <fstream>
#include <limits.h>
#include <unistd.h>
@lindenb
lindenb / README.md
Created March 21, 2019 11:37
"custom module" modulepath path

create directory

mkdir -p .modulefiles/reference/human

create the module file .modulefiles/reference/human/GRCh37.75.lua

usage:

$ ls input.bed
$ java -jar dist/samjdk.jar --body -f biostar368754.code input.bam
@lindenb
lindenb / README.md
Created March 5, 2019 20:56
https://www.biostars.org/p/367522 Plotting overlapping genomic segments in R :: svg xml
echo -e '@HD\tVN:1.4\tSO:unsorted\n@SQ\tSN:2\tLN:243199373' > tmp.dict &&  \
java -jar dist/biostar336589.jar -a 60 -R tmp.dict <(grep -v Chr input.bed)  > out.svg
@lindenb
lindenb / README.md
Last active February 22, 2019 14:49
https://www.biostars.org/p/365479/ Question: Bioinformatics word cloud to use in classes bioinformatics xml pubmed ncbi cloud word xslt jvarkit

Example

Mesh words in 'Oxford Bioinformatics' 2018.

 java -jar dist/pubmeddump.jar 'Bioinformatics[journal] AND 2018[PDAT]'| \
 java -jar dist/xsltstream.jar --tag PubmedArticle -t biostars365479.xsl > out.txt
@lindenb
lindenb / biostars365290.xsl
Created February 21, 2019 17:52
Question: Retrieving assembly statistics for several accessions https://www.biostars.org/p/365290/ ncbi xsl xslt xml genome assembly
<?xml version='1.0' encoding="UTF-8" ?>
<xsl:stylesheet
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns:h='http://www.w3.org/1999/xhtml'
version='1.0'>
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:apply-templates select="//h:table[@summary='Global statistics']/h:tbody/h:tr"/>
<?xml version='1.0' encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'
>
<xsl:output method="text"/>
<xsl:template match="/">
create table if not exists EXPERIMENT
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
alias TEXT,
center_name TEXT,
@lindenb
lindenb / pubmed.user.js
Created February 7, 2019 12:07
Greasemonkey script adding link to pubmed2bibtex pubmed ncbi tex bibtex greasemonkey user script
// ==UserScript==
// @description Display posts of a reddit user
// @grant none
// @include https://www.ncbi.nlm.nih.gov/pubmed*
// @name pubmed
// @namespace https://github.com/lindenb/greasemonkey
// ==/UserScript==
var array=[];
var iter = document.evaluate("//p/a[starts-with(@href,'/pubmed?linkname=pubmed_pubmed&from_uid=') and text()='Similar articles']",document,null,XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);
@lindenb
lindenb / biostar362495.xsl
Created February 7, 2019 10:07
https://www.biostars.org/p/362495/ biostars filter blastp blast xslt xslt xml
<?xml version='1.0' encoding="UTF-8" ?>
<xsl:stylesheet
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
version='1.0'
>
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:template match="*">
<xsl:copy>
@lindenb
lindenb / biostar362172.html
Created February 5, 2019 23:00
https://www.biostars.org/p/362172/ Tool for rendering quick PNG/SVG/etc. from a single BED12 element? javascript bed svg bed12 gene transcript
<html xmlns:xhtml="http://www.w3.org/1999/xhtml">
<head>
<script>
function element(name) {
return document.createElementNS("http://www.w3.org/2000/svg",name);
}
function run() {