# HG changeset patch # User vandelj # Date 1599647334 0 # Node ID 0435f94d27a76e3a9fba3fdf0c45165f0fe84ed9 # Parent 488e6e8bb8cbe105fd0c0e4baf138ca37f5ccbdf "planemo upload for repository https://github.com/juliechevalier/GIANT/tree/master commit e2b27d6ff2eab66454f984dbf1a519192f41db97" diff -r 488e6e8bb8cb -r 0435f94d27a7 galaxy/wrappers/ExprQCplots.xml --- a/galaxy/wrappers/ExprQCplots.xml Fri Jun 26 09:41:56 2020 -0400 +++ b/galaxy/wrappers/ExprQCplots.xml Wed Sep 09 10:28:54 2020 +0000 @@ -1,4 +1,4 @@ - + Descriptive plots of .CEL collections or normalized expression data bioconductor-oligo @@ -8,6 +8,7 @@ r-mgcv + 1) or ($dataType == "tabular" and len($dataFile)==1): - Rscript '$__tool_directory__/../../src/ExprPlotsScript.R' -i '$dataFile' -l '$log' -f '$advSection.imageFormat' -j '$dataType' + #if ($dataType == "cel" and len($inputData)>1) or ($dataType == "tabular" and len($inputData)==1): + Rscript '$__tool_directory__/../../src/ExprPlotsScript.R' -i '$inputData' -l '$log' -f '$advSection.imageFormat' -j '$dataType' + ##change for Planemo test + ##Rscript '$__tool_directory__/src/ExprPlotsScript.R' -i '$inputData' -l '$log' -f '$advSection.imageFormat' -j '$dataType' #if $dataType == "cel": - #for $inputDataset in $dataFile + #for $inputDataset in $inputData -c '${inputDataset.name}' #end for #end if @@ -95,7 +98,7 @@ - +
@@ -396,7 +399,7 @@
- + @@ -442,7 +445,7 @@ - plotSection['microarrayToPlot'] and dataFile[0].ext == "cel" + plotSection['microarrayToPlot'] and inputData[0].ext == "cel" @@ -458,20 +461,25 @@ - - - - - - - - - - - - - - + +
+ + + + +
+
+ + + +
+
+ + +
+ + +
diff -r 488e6e8bb8cb -r 0435f94d27a7 src/General_functions.py --- a/src/General_functions.py Fri Jun 26 09:41:56 2020 -0400 +++ b/src/General_functions.py Wed Sep 09 10:28:54 2020 +0000 @@ -1,5 +1,6 @@ import re import numpy as np +import galaxy.model def get_column_names( file_path, toNotConsider=-1, each=1): options=[] @@ -76,7 +77,7 @@ def get_condition_file_names( file_list, toNotConsider=-1, each=1): options=[] - if not isinstance(file_list,list):#if input file is a tabular file, act as get_column_names + if not (isinstance(file_list,list) or isinstance(file_list,galaxy.model.HistoryDatasetCollectionAssociation) or isinstance(file_list,galaxy.model.DatasetCollection)) :#if input file is a tabular file, act as get_column_names inputfile = open(file_list.file_name) firstLine = next(inputfile).strip().split("\t") cpt=0 @@ -88,13 +89,17 @@ if cpt==each: cpt=0 inputfile.close() - else:#if input file is a .cel file list or a collection - if not hasattr(file_list[0],'collection'):#if it is not a collection, get name easily - for i, field_component in enumerate( file_list ): - options.append( ( field_component.name, field_component.name, False ) ) - else:#if the file is a collection, have to get deeper in the corresponding HistoryDatasetCollectionAssociation object - for i, field_component in enumerate( file_list[0].collection.elements ): - options.append( ( field_component.element_identifier, field_component.element_identifier, False ) ) + else:#if input file is a .cel file list, a DatasetCollection or a HistoryDatasetCollectionAssociation + if isinstance(file_list,list):#if it is a list, retrieve names easily + for i, field_component in enumerate( file_list ): + options.append( ( field_component.name, field_component.name, False ) ) + else:#if the file is a DatasetCollection, have to get deeper in the corresponding DatasetCollection object + if isinstance(file_list,galaxy.model.DatasetCollection):#if it is a list, retrieve names easily + for i, field_component in enumerate( file_list.elements ): + options.append( ( field_component.element_identifier, field_component.element_identifier, False ) ) + else:#if the file is a HistoryDatasetCollectionAssociation, have to get a little bit deeper in the corresponding HistoryDatasetCollectionAssociation object + for i, field_component in enumerate( file_list.collection.elements ): + options.append( ( field_component.element_identifier, field_component.element_identifier, False ) ) return options def generateFactorFile( file_list, factor_list, outputFileName, logFile): @@ -102,10 +107,7 @@ outputfile = open(outputFileName, 'w') outputLog = open(logFile, 'w') sampleList=[] - if not isinstance(file_list,list): - conditionNames=get_condition_file_names(file_list,0) #unique expression file, remove the first column (index=0) - else : - conditionNames=get_condition_file_names(file_list) #.CEL files + conditionNames=get_condition_file_names(file_list,0) #if it's a unique expression file, remove the first column (index=0) for iSample, sample_component in enumerate (conditionNames): sampleList.append(str(sample_component[1])) outputLog.write("[INFO] "+str(len(sampleList))+" sample are detected as input\n")