comparison xena_import.py @ 2:6eeb3ca663fb

Fixed dataset delete bugs (the full pathname was needed) plus changed xena_import to give a checkbox for turning on column normalization
author melissacline
date Wed, 14 Jan 2015 15:21:09 -0800
parents 8bb037f88ed2
children d8dc482ef970
comparison
equal deleted inserted replaced
1:ca4510434eda 2:6eeb3ca663fb
50 parser.add_argument("--json", type=str, default=None) 50 parser.add_argument("--json", type=str, default=None)
51 parser.add_argument("--cohort", type=str) 51 parser.add_argument("--cohort", type=str)
52 parser.add_argument("--type", type=str) 52 parser.add_argument("--type", type=str)
53 parser.add_argument("--dataSubType", type=str, default=None) 53 parser.add_argument("--dataSubType", type=str, default=None)
54 parser.add_argument("--label", type=str, default=None) 54 parser.add_argument("--label", type=str, default=None)
55 parser.add_argument("--colNormalization", type=bool, default=False)
55 args = parser.parse_args() 56 args = parser.parse_args()
56 57
57 fp2 = open(args.outfile, "w") 58 fp2 = open(args.outfile, "w")
58 fp2.write("Importing data to Xena\n") 59 fp2.write("Importing data to Xena\n")
59 xenaFileDir = xena.fileDir() 60 xenaFileDir = xena.fileDir()
76 metadata = { 'cohort': args.cohort, 'type': args.type } 77 metadata = { 'cohort': args.cohort, 'type': args.type }
77 if args.dataSubType is not None: 78 if args.dataSubType is not None:
78 metadata['dataSubType'] = args.dataSubType 79 metadata['dataSubType'] = args.dataSubType
79 if args.label is not None: 80 if args.label is not None:
80 metadata['label'] = args.label 81 metadata['label'] = args.label
82 if args.colNormalization:
83 metadata['colNormalization'] = "true"
84 else:
85 updateColNormalization(metadata)
81 jsonMetadata = json.dumps(metadata, indent=2) 86 jsonMetadata = json.dumps(metadata, indent=2)
82 fp = open(jsonMetadataTargetPathname, "w") 87 fp = open(jsonMetadataTargetPathname, "w")
83 fp.write("%s\n" % (jsonMetadata)) 88 fp.write("%s\n" % (jsonMetadata))
84 fp.close() 89 fp.close()
85 90