-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from VIB-PSB/feature/icres-based-grns
Feature/icres based grns
- Loading branch information
Showing
17 changed files
with
2,618 additions
and
31 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
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
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# %% | ||
import argparse | ||
|
||
def parseArgs(): | ||
|
||
parser = argparse.ArgumentParser(prog = 'Script to get a BED file with iCREs ' + \ | ||
'coordinates given a list of genes', | ||
conflict_handler='resolve') | ||
|
||
parser.add_argument('annotated_icres', type = str, | ||
help = '', | ||
metavar = 'BED file with 4th column being ' +\ | ||
'an annotated gene ID') | ||
|
||
parser.add_argument('gene_list', type = str, | ||
help = '', | ||
metavar = 'One column file containing gene IDs '+ \ | ||
'of interest') | ||
|
||
parser.add_argument('bed_of_genes_icres', type = str, | ||
help = '', | ||
metavar = 'Output BED file with coordinates '+\ | ||
'of iCREs associated with genes of interest') | ||
|
||
args = parser.parse_args() | ||
|
||
return args | ||
|
||
args = parseArgs() | ||
|
||
annot_icres = args.annotated_icres | ||
genes_oi_file = args.gene_list | ||
output_file = args.bed_of_genes_icres | ||
|
||
# %% | ||
genes_oi = set() | ||
|
||
with open(genes_oi_file, "r") as fin: | ||
for line in fin: | ||
rec = line.strip().split("\t") | ||
gene_id = rec[0] | ||
genes_oi.add(gene_id) | ||
|
||
with open(output_file, "w") as fout: | ||
with open(annot_icres, "r") as fin: | ||
for line in fin: | ||
rec = line.strip().split("\t") | ||
gene_id = rec[3] | ||
if gene_id in genes_oi: | ||
fout.write("\t".join(rec[0:3])) | ||
fout.write("\n") |
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
Oops, something went wrong.