Skip to content

Commit

Permalink
Merge pull request #209 from Sage-Bionetworks/rename-bed-file
Browse files Browse the repository at this point in the history
Rename bed file
  • Loading branch information
thomasyu888 authored Oct 26, 2019
2 parents 301f907 + d84359b commit c78c0d3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions genie/consortium_to_public.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def consortiumToPublic(syn, processingDate, genie_version, releaseId, databaseSy
MUTATIONS_PATH = os.path.join(dbTostaging.GENIE_RELEASE_DIR,'data_mutations_extended_%s.txt' % genie_version)
FUSIONS_PATH = os.path.join(dbTostaging.GENIE_RELEASE_DIR,'data_fusions_%s.txt' % genie_version)
SEG_PATH = os.path.join(dbTostaging.GENIE_RELEASE_DIR,'genie_public_data_cna_hg19_%s.seg' % genie_version)
COMBINED_BED_PATH = os.path.join(dbTostaging.GENIE_RELEASE_DIR,'genie_combined_%s.bed' % genie_version)
COMBINED_BED_PATH = os.path.join(dbTostaging.GENIE_RELEASE_DIR,'genomic_information_%s.txt' % genie_version)

if not os.path.exists(dbTostaging.GENIE_RELEASE_DIR):
os.mkdir(dbTostaging.GENIE_RELEASE_DIR)
Expand Down Expand Up @@ -186,12 +186,12 @@ def consortiumToPublic(syn, processingDate, genie_version, releaseId, databaseSy
# panelDf = panelDf[panelDf['SAMPLE_ID'].isin(publicReleaseSamples)]
# panelDf.to_csv(DATA_GENE_PANEL_PATH,sep="\t",index=False)
# storeFile(syn, DATA_GENE_PANEL_PATH, PUBLIC_RELEASE_PREVIEW, ANONYMIZE_CENTER_DF, genie_version, name="data_gene_matrix.txt")
elif entName == "genie_combined.bed":
elif entName == "genomic_information.txt":
bed = syn.get(entId, followLink=True)
bedDf = pd.read_csv(bed.path, sep="\t")
bedDf = bedDf[bedDf.SEQ_ASSAY_ID.isin(allClin.SEQ_ASSAY_ID)]
bedDf.to_csv(COMBINED_BED_PATH,sep="\t",index=False)
storeFile(syn, COMBINED_BED_PATH, PUBLIC_RELEASE_PREVIEW, ANONYMIZE_CENTER_DF, genie_version, name="genie_combined.bed")
storeFile(syn, COMBINED_BED_PATH, PUBLIC_RELEASE_PREVIEW, ANONYMIZE_CENTER_DF, genie_version, name="genomic_information.txt")
elif entName in ["data_clinical_sample.txt", "data_clinical_patient.txt"] or entName.endswith(".html"):
continue
elif entName.startswith("data_gene_panel"):
Expand Down
2 changes: 1 addition & 1 deletion genie/dashboardTemplate.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ if (is.null(this_samples)) {
this_patient <- this_samples
this_patient <- this_patient[!duplicated(this_patient$PATIENT_ID),]
}
this_bed <- getFileDf("genie_combined.bed", releaseFiles)
this_bed <- getFileDf("genomic_information.txt", releaseFiles)
this_assays = as.character(unique(this_samples$SEQ_ASSAY_ID))
this_mut <- getFileDf("data_mutations_extended.txt", releaseFiles)
black_list_variants <- synTableQuery("select * from syn18459663",
Expand Down
4 changes: 2 additions & 2 deletions genie/database_to_staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def stagingToCbio(
SEG_PATH = os.path.join(
GENIE_RELEASE_DIR, 'genie_private_data_cna_hg19_%s.seg' % genieVersion)
COMBINED_BED_PATH = os.path.join(
GENIE_RELEASE_DIR, 'genie_combined_%s.bed' % genieVersion)
GENIE_RELEASE_DIR, 'genomic_information_%s.txt' % genieVersion)
consortiumReleaseSynId = databaseSynIdMappingDf['Id'][
databaseSynIdMappingDf['Database'] == "consortium"][0]
variant_filtering_synId = databaseSynIdMappingDf['Id'][
Expand Down Expand Up @@ -1110,7 +1110,7 @@ def stagingToCbio(
syn, COMBINED_BED_PATH,
parent=consortiumReleaseSynId,
genieVersion=genieVersion,
name="genie_combined.bed",
name="genomic_information.txt",
staging=current_release_staging)

return(genePanelEntities)
Expand Down
4 changes: 2 additions & 2 deletions genie/maf.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ def createFinalMaf(self, mafDf, filePath, maf=False):
mafset = mafDf.to_csv(sep="\t", index=False)
else:
mafset = mafDf.to_csv(sep="\t", index=False, header=None)
write_or_append = "w" if maf else "a"
write_or_append = "wb" if maf else "ab"
with open(filePath, write_or_append) as maffile:
mafSet = process_functions.removeStringFloat(mafset)
maffile.write(mafSet)
maffile.write(mafSet.encode("utf-8"))

def storeProcessedMaf(
self, filePath, mafSynId, centerMafSynId, isNarrow=False):
Expand Down

0 comments on commit c78c0d3

Please sign in to comment.