Skip to content

Commit

Permalink
Merge pull request #83 from PNNL-CompBio/data-trigger
Browse files Browse the repository at this point in the history
more build files added
  • Loading branch information
sgosline authored Apr 17, 2024
2 parents ad189ce + 2ac15e2 commit 9a72fd9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion bmd2Samps_v3/buildv3database.R
Original file line number Diff line number Diff line change
Expand Up @@ -892,13 +892,14 @@ main<-function(){
parser$add_argument('-s','--sample',dest='is_sample',action='store_true',default=FALSE,help='Flag to indicate file are for samples')
parser$add_argument('-c','--chemical',dest='is_chem',default=FALSE,action='store_true',
help='Flag to indicate file is for chemicals')
parser$add_argument('-d','--drcFile',dest='dose_res_stat',default'',help='dose response curve file')
parser$add_argument('-d','--drcFiles',dest='dose_res_stat',default='',help='dose response curve file')
parser$add_argument('-p','--sampMap',dest='sample_mapping_file',default='',help='Sample mapping file location')
parser$add_argument('-m','--chemMap',dest='chem_meta_file',default='',help='Chemical metadata file location')
parser$add_argument('-e','--epMap',dest='endpoint_mapping_file',default='',help='Endpoint naming file location')
parser$add_argument('-l','--chemClass',dest='chem_class_file',default='',help='chemical class file location')
parser$add_argument('-x','--compToxFile',dest='comp_tox_mapping',default='',help='comptox data file location')
parser$add_argument('-f','--sampleFiles',dest='sample_files',default='',help='comma dlimited list of fses files to merge' )
parser$add_argument('-h','--chemDesc',dest='chem_desc',default='',help='Descriptions of chemicals')


args <- parser$parse_args()
Expand Down
3 changes: 2 additions & 1 deletion data/srp_build_files.csv
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ chemMap,mapping,chemical,https://raw.githubusercontent.com/PNNL-CompBio/srpAnaly
sampMap,mapping,sample,https://raw.githubusercontent.com/PNNL-CompBio/srpAnalytics/main/data/sampleIdMapping.csv,1
class1,classification,chemical,https://raw.githubusercontent.com/PNNL-CompBio/srpAnalytics/main/data/MASV%20Classifications%202021.xlsx,1
compTox,mapping,chemical,https://github.com/PNNL-CompBio/srpAnalytics/blob/main/data/CCDBatch_2022-01-26_AND_2021_11_05.xlsx,1
endpointMap,mapping,endpoint,https://github.com/PNNL-CompBio/srpAnalytics/blob/main/data/SuperEndpoint%20Mapping%202021NOV04.xlsx,1
endpointMap,mapping,endpoint,https://github.com/PNNL-CompBio/srpAnalytics/blob/main/data/SuperEndpoint%20Mapping%202021NOV04.xlsx,1
chemdesc,classification,chemical,https://github.com/PNNL-CompBio/srpAnalytics/blob/main/data/ChemicalDescriptions.xlsx,1
17 changes: 9 additions & 8 deletions v3_buildScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,18 @@ def main():
sampfiles.append(fname)

##now map sample information
smap = df.loc[df.name=='sampMap'].location
cmap = df.loc[df.name=='chemMap'].location
cclass = df.loc[df.name=='class1'].location
emap = df.loc[df.name=='endpointMap'].location
fses = ','.join(df.loc[df.data_type=='sample'].location)
ctfile = df.loc[df.name=='colmpTox'].location
smap = list(df.loc[df.name=='sampMap'].location)[0]
cmap = list(df.loc[df.name=='chemMap'].location)[0]
cclass = list(df.loc[df.name=='class1'].location)[0]
emap = list(df.loc[df.name=='endpointMap'].location)[0]
fses = ','.join(list(df.loc[df.data_type=='sample'].location))
ctfile = list(df.loc[df.name=='compTox'].location)[0]
desfile = list(df.loc[df.name=='chemdesc'].location)[0]

##call script with sample files
cmd = "Rscript bmd2Samps_v3/buildV3database.R --sample --drcFile="+','.join(sampfiles)+\
cmd = "Rscript bmd2Samps_v3/buildV3database.R --sample --drcFiles="+','.join(sampfiles)+\
' --sampMap='+smap+' --chemMap='+cmap+' --epMap='+emap+' --chemClass='+cclass+\
' --compToxFile='+ctfile+' --sampleFiles='+fses
' --compToxFile='+ctfile+' --sampleFiles='+fses+' --chemDesc='+desfile
print(cmd)
os.system(cmd)
##call script with chemical files
Expand Down

0 comments on commit 9a72fd9

Please sign in to comment.