changeset 51:728eda331f07

better handle of input
author jingchunzhu@gmail.com
date Thu, 17 Sep 2015 14:33:21 -0700
parents b6f5d2d1b047
children 3a036a34c362
files seg2matrix/mapSegToGeneMatrix.py segToGeneMatrix.xml
diffstat 2 files changed, 23 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/seg2matrix/mapSegToGeneMatrix.py	Tue Aug 25 23:42:17 2015 -0700
+++ b/seg2matrix/mapSegToGeneMatrix.py	Thu Sep 17 14:33:21 2015 -0700
@@ -35,9 +35,14 @@
     while 1:
         count = count+1
         #print count
-        line =string.strip(fin.readline())
-        if line =="":
+        line =fin.readline()
+        if line =="": # end of file
             break
+        if count ==1:
+            continue #ignore the first line
+        line = string.strip(line)
+        if line == "": # empty line
+            continue
         if line[0]=="#":
             continue
         tmp = string.split(line,"\t")
--- a/segToGeneMatrix.xml	Tue Aug 25 23:42:17 2015 -0700
+++ b/segToGeneMatrix.xml	Thu Sep 17 14:33:21 2015 -0700
@@ -6,9 +6,9 @@
     seg2matrix/mapSegToGeneMatrix.py $input $__tool_directory__/seg2matrix/$refGene.assembly $outputMatrix
   </command>
   <inputs>
-    <param name="input" format="tabular" type="data" multiple="false" label="Input segmented copy number data" />
+    <param name="input" format="tabular" type="data" multiple="false" label="Input segmented copy number data" help="See input data format section for required input format" />
     <conditional name="refGene">
-      <param name="assembly_select" type="select" label="Which human genome assembly is your input segmented copy number data?">
+      <param name="assembly_select" type="select" label="Which human genome assembly is your input segmented copy number data?" help="Copy number segments will be map to RefGenes of the selected assembly.">
 	<option value="hg19">hg19</option>
 	<option value="hg18">hg18</option>
       </param>
@@ -25,9 +25,21 @@
   </outputs>
   <help>
 
-    **Given a segmented copy number data file, convert it into gene-level matrix data, also xena ready**
+**Given a segmented copy number data file, convert it into gene-level matrix data, also xena ready**
+
+1. Input data file format: tab-deliminated
 
-    Output File no 1. matrix file
+   =======    =====  ======= ===== ====== ======
+   sanmple    chr    start   end   strand value
+   =======    =====  ======= ===== ====== ======
+   sample1    chr1   1       100   .      0.5
+   sample2    chr1   101     1000  .      1.5
+   sample3    chr1   1000    2000  .      -0.5
+   ...        ...    ...     ...   ...    ...
+   =======    =====  ======= ===== ====== ====== 
+
+
+2. Output file: gene-level matrix file
 
   </help>
 </tool>