Skip to content

Instantly share code, notes, and snippets.

Avatar

Wei Li davidliwei

View GitHub Profile
@davidliwei
davidliwei / getinsertsize.py
Last active Sep 13, 2021
Estimating NGS paired-end read insert size (or fragment length) from SAM/BAM files
View getinsertsize.py
#!/usr/bin/env python
'''
Automatically estimate insert size of the paired-end reads for a given SAM/BAM file.
Usage: getinsertsize.py <SAM file> or samtools view <BAM file> | getinsertsize.py -
Author: Wei Li
Copyright (c) <2015> <Wei Li>
@davidliwei
davidliwei / getinsertsize.py
Created Aug 24, 2011
This script extracts insert size mean and std, mass of mapped read information from Cufflinks log outputs.
View getinsertsize.py
#!/bin/env python3
import os
import re
import sys
if len(sys.argv)<2:
print('This script extracts insert size information from Cufflinks logs.',file=sys.stderr);
print('Usage: getinsertsize [cufflinks log file]',file=sys.stderr);
print('Note: you may specify different log files using filename wildcards.',file=sys.stderr);
@davidliwei
davidliwei / gtf2bed.py
Created Aug 18, 2011
Converting Cufflinks predictions (.GTF) into .BED annotations
View gtf2bed.py
#!/usr/bin/env python3
'''
gtf2bed.py converts GTF file to BED file.
Usage: gtf2bed.py {OPTIONS} [.GTF file]
History
Nov.5th 2012:
1. Allow conversion from general GTF files (instead of only Cufflinks supports).
2. If multiple identical transcript_id exist, transcript_id will be appended a string like "_DUP#" to separate.
'''