projectUUID := flags.String("project", "", "project `UUID` for output data")
inputDirectory := flags.String("i", "-", "input `directory` (output of slice-numpy -single-onehot)")
outputFilename := flags.String("o", "", "output `filename` (e.g., './plot.png')")
+ csvOutputFilename := flags.String("csv-output", "", "csv output `filename` (e.g., './tile-locations-pvalues.csv')")
+ csvOutputThreshold := flags.Float64("csv-output-threshold", 0, "logpvalue threshold for csv output (0 for none)")
priority := flags.Int("priority", 500, "container request priority")
runlocal := flags.Bool("local", false, "run on local host (default: run in an arvados container)")
err = flags.Parse(args)
return 1
}
*outputFilename = "/mnt/output/plot.png"
+ *csvOutputFilename = "/mnt/output/tile-locations-pvalues.csv"
}
args = []string{
*inputDirectory,
*outputFilename,
+ fmt.Sprintf("%g", *csvOutputThreshold),
+ *csvOutputFilename,
}
if *runlocal {
if *outputFilename == "" {
(_,
input_path,
output_path,
+ csv_threshold_str,
+ csv_output_path,
) = sys.argv
+csv_threshold = float(csv_threshold_str)
+
columns = numpy.load(os.path.join(input_path, 'onehot-columns.npy'))
# pvalue maps tag# => [pvalue1, pvalue2, ...] (one het p-value and one hom p-value for each tile variant)
if annotation[3] == "=":
tilepos[int(annotation[0])] = (annotation[4], int(annotation[5]))
+if csv_threshold > 0 and csv_output_path != "":
+ with open(csv_output_path, 'wt') as f:
+ for tag, chrpos in sorted(tilepos.items(), key=lambda item: (item[1][0][-1] > '9', item[1][0].lstrip('chr').zfill(2), item[1][1])):
+ for p in pvalue.get(tag, []):
+ if p < pow(10, -csv_threshold):
+ print(f'{tag},{chrpos[0]},{chrpos[1]},{p}', file=f)
+
series = {"#CHROM": [], "POS": [], "P": []}
for tag, chrpos in sorted(tilepos.items(), key=lambda item: (item[1][0][-1] > '9', item[1][0].lstrip('chr').zfill(2), item[1][1])):
for p in pvalue.get(tag, []):