# HG changeset patch # User jingchunzhu@gmail.com # Date 1442525601 25200 # Node ID 728eda331f071d5e891fceb0b0d13a5a0bf766a7 # Parent b6f5d2d1b0476596436b0ec160c18dce62520686 better handle of input diff -r b6f5d2d1b047 -r 728eda331f07 seg2matrix/mapSegToGeneMatrix.py --- 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") diff -r b6f5d2d1b047 -r 728eda331f07 segToGeneMatrix.xml --- 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 - + - + @@ -25,9 +25,21 @@ - **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