-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
67 changed files
with
258 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
#!/usr/bin/env | ||
''' | ||
""" | ||
Extract lincRNA coordinates from GTF | ||
''' | ||
""" | ||
import sys | ||
import GTF | ||
import numpy as np | ||
import pandas as pd | ||
|
||
|
||
def main(GENCODE): | ||
gc = GTF.dataframe(GENCODE) | ||
gc.gene_id = gc.gene_id.replace(to_replace=r'\.[0-9]+', value='', regex=True) | ||
gc.gene_id = gc.gene_id.replace(to_replace=r"\.[0-9]+", value="", regex=True) | ||
|
||
idx = (gc.feature == 'transcript') & (gc.transcript_type == 'lincRNA') | ||
lincRNA = gc.ix[idx, ['seqname','start','end','gene_id','gene_name', 'strand']] | ||
idx = (gc.feature == "transcript") & (gc.transcript_type == "lincRNA") | ||
lincRNA = gc.ix[idx, ["seqname", "start", "end", "gene_id", "gene_name", "strand"]] | ||
lincRNA.start = lincRNA.start.astype(int) | ||
lincRNA.end = lincRNA.end.astype(int) | ||
lincRNA.sort_values(by=['seqname','start','end'], inplace=True) | ||
lincRNA.to_csv('lincRNA.bed', sep='\t', header=False, index=False) | ||
lincRNA.sort_values(by=["seqname", "start", "end"], inplace=True) | ||
lincRNA.to_csv("lincRNA.bed", sep="\t", header=False, index=False) | ||
|
||
idx = (gc.feature == 'gene') & (gc.gene_type == 'lincRNA') | ||
lincRNA = gc.ix[idx, ['seqname','start','end','gene_id','gene_name', 'strand']] | ||
idx = (gc.feature == "gene") & (gc.gene_type == "lincRNA") | ||
lincRNA = gc.ix[idx, ["seqname", "start", "end", "gene_id", "gene_name", "strand"]] | ||
lincRNA.start = lincRNA.start.astype(int) | ||
lincRNA.end = lincRNA.end.astype(int) | ||
lincRNA.sort_values(by=['seqname','start','end'], inplace=True) | ||
lincRNA.to_csv('lincRNA_genes.bed', sep='\t', header=False, index=False) | ||
lincRNA.sort_values(by=["seqname", "start", "end"], inplace=True) | ||
lincRNA.to_csv("lincRNA_genes.bed", sep="\t", header=False, index=False) | ||
|
||
|
||
if __name__ == '__main__': | ||
if __name__ == "__main__": | ||
main(sys.argv[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
#!/usr/bin/env | ||
''' | ||
""" | ||
Extract rRNA coordinates from GTF | ||
''' | ||
""" | ||
import sys | ||
import GTF | ||
import numpy as np | ||
import pandas as pd | ||
|
||
|
||
def main(GENCODE): | ||
gc = GTF.dataframe(GENCODE) | ||
gc.gene_id = gc.gene_id.replace(to_replace=r'\.[0-9]+', value='', regex=True) | ||
gc.gene_id = gc.gene_id.replace(to_replace=r"\.[0-9]+", value="", regex=True) | ||
|
||
idx = (gc.feature == 'transcript') & gc.transcript_type.str.contains('rRNA') | ||
rRNA = gc.ix[idx, ['seqname','start','end','transcript_id','gene_name', 'strand']] | ||
idx = (gc.feature == "transcript") & gc.transcript_type.str.contains("rRNA") | ||
rRNA = gc.ix[ | ||
idx, ["seqname", "start", "end", "transcript_id", "gene_name", "strand"] | ||
] | ||
rRNA.start = rRNA.start.astype(int) | ||
rRNA.end = rRNA.end.astype(int) | ||
rRNA.sort_values(by=['seqname','start','end'], inplace=True) | ||
rRNA.to_csv('rRNA_transcripts.bed', sep='\t', header=False, index=False) | ||
rRNA.sort_values(by=["seqname", "start", "end"], inplace=True) | ||
rRNA.to_csv("rRNA_transcripts.bed", sep="\t", header=False, index=False) | ||
|
||
idx = (gc.feature == 'gene') & gc.gene_type.str.contains('rRNA') | ||
rRNA = gc.ix[idx, ['seqname','start','end','gene_id','gene_name', 'strand']] | ||
idx = (gc.feature == "gene") & gc.gene_type.str.contains("rRNA") | ||
rRNA = gc.ix[idx, ["seqname", "start", "end", "gene_id", "gene_name", "strand"]] | ||
rRNA.start = rRNA.start.astype(int) | ||
rRNA.end = rRNA.end.astype(int) | ||
rRNA.sort_values(by=['seqname','start','end'], inplace=True) | ||
rRNA.to_csv('rRNA_genes.bed', sep='\t', header=False, index=False) | ||
rRNA.sort_values(by=["seqname", "start", "end"], inplace=True) | ||
rRNA.to_csv("rRNA_genes.bed", sep="\t", header=False, index=False) | ||
|
||
if __name__ == '__main__': | ||
main(sys.argv[1]) | ||
|
||
if __name__ == "__main__": | ||
main(sys.argv[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
#!/usr/bin/env | ||
''' | ||
""" | ||
Extract tRNA coordinates from GTF | ||
''' | ||
""" | ||
import sys | ||
import GTF | ||
import numpy as np | ||
import pandas as pd | ||
|
||
|
||
def main(GENCODE): | ||
gc = GTF.dataframe(GENCODE) | ||
gc.gene_id = gc.gene_id.replace(to_replace=r'\.[0-9]+', value='', regex=True) | ||
gc.gene_id = gc.gene_id.replace(to_replace=r"\.[0-9]+", value="", regex=True) | ||
|
||
idx = (gc.feature == 'transcript') & gc.transcript_type.str.contains('tRNA') | ||
tRNA = gc.ix[idx, ['seqname','start','end','transcript_id','gene_name', 'strand']] | ||
idx = (gc.feature == "transcript") & gc.transcript_type.str.contains("tRNA") | ||
tRNA = gc.ix[ | ||
idx, ["seqname", "start", "end", "transcript_id", "gene_name", "strand"] | ||
] | ||
tRNA.start = tRNA.start.astype(int) | ||
tRNA.end = tRNA.end.astype(int) | ||
tRNA.sort_values(by=['seqname','start','end'], inplace=True) | ||
tRNA.to_csv('tRNA_transcripts.bed', sep='\t', header=False, index=False) | ||
tRNA.sort_values(by=["seqname", "start", "end"], inplace=True) | ||
tRNA.to_csv("tRNA_transcripts.bed", sep="\t", header=False, index=False) | ||
|
||
idx = (gc.feature == 'gene') & gc.gene_type.str.contains('tRNA') | ||
tRNA = gc.ix[idx, ['seqname','start','end','gene_id','gene_name', 'strand']] | ||
idx = (gc.feature == "gene") & gc.gene_type.str.contains("tRNA") | ||
tRNA = gc.ix[idx, ["seqname", "start", "end", "gene_id", "gene_name", "strand"]] | ||
tRNA.start = tRNA.start.astype(int) | ||
tRNA.end = tRNA.end.astype(int) | ||
tRNA.sort_values(by=['seqname','start','end'], inplace=True) | ||
tRNA.to_csv('tRNA_genes.bed', sep='\t', header=False, index=False) | ||
tRNA.sort_values(by=["seqname", "start", "end"], inplace=True) | ||
tRNA.to_csv("tRNA_genes.bed", sep="\t", header=False, index=False) | ||
|
||
if __name__ == '__main__': | ||
main(sys.argv[1]) | ||
|
||
if __name__ == "__main__": | ||
main(sys.argv[1]) |
Oops, something went wrong.