Skip to content

Commit

Permalink
fix alias loading
Browse files Browse the repository at this point in the history
  • Loading branch information
chaochungkuo committed Jun 25, 2021
1 parent 4db81bc commit 59e9973
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions rgt/AnnotationSet.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,15 +306,16 @@ def load_alias_dict(self, file_name):
# Iterating over alias file entries
for line in alias_file:
ll = line.strip().split("\t")
ensembl_id = ll[0]
official_name = ll[1]
alias_vec = ll[2].split("&")
self.symbol_dict[ensembl_id] = official_name
for e in alias_vec:
try:
self.alias_dict[e].append(ensembl_id)
except Exception:
self.alias_dict[e] = [ensembl_id]
if len(ll) > 2:
ensembl_id = ll[0]
official_name = ll[1]
alias_vec = ll[2].split("&")
self.symbol_dict[ensembl_id] = official_name
for e in alias_vec:
try:
self.alias_dict[e].append(ensembl_id)
except Exception:
self.alias_dict[e] = [ensembl_id]

# Termination
alias_file.close()
Expand Down
2 changes: 1 addition & 1 deletion test/tdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fi

# Run test script
cd ${DIR}/TDF_examples/FENDRR_mm9/
rgt-TDF promotertest -r FENDRR.fasta -de fendrr_gene_list_fold_change.txt -score -organism mm9 -rn FENDRR -o promoter_test -t FENDRR_FC/ -l 20
rgt-TDF promotertest -r FENDRR.fasta -de fendrr_gene_list_fold_change.txt -score -organism mm9 -rn FENDRR -o promoter_test -t FENDRR_FC/ -l 15
rgt-TDF integrate -path promoter_test

cd ${DIR}/TDF_examples/MEG3_hg38/
Expand Down

0 comments on commit 59e9973

Please sign in to comment.