https://github.com/arjunrajlaboratory/RajLabSeqTools
Tip revision: c8b8c79b2ec9c1bd9eb7ced427bb2aec25f19506 authored by Benjamin Emert on 26 March 2020, 17:37:11 UTC
Updated reorganizeBasespaceFiles.py to better parse samples with same first index (e.g. sample 1 and sample10)
Updated reorganizeBasespaceFiles.py to better parse samples with same first index (e.g. sample 1 and sample10)
Tip revision: c8b8c79
gtf2bed.py
import gffutils
db = gffutils.create_db(snakemake.input[0],
dbfn=snakemake.output.db,
force=True,
keep_order=True,
merge_strategy='merge',
sort_attribute_values=True,
disable_infer_genes=True,
disable_infer_transcripts=True)
with open(snakemake.output.bed, 'w') as outfileobj:
for tx in db.features_of_type('transcript', order_by='start'):
bed = [s.strip() for s in db.bed12(tx).split('\t')]
bed[3] = tx.id
outfileobj.write('{}\n'.format('\t'.join(bed)))
