func main() {
	defer STDOUT.Flush()

	var path, output, fileList string
	var filetypes string

	flag.StringVar(&path, "path", "", "Path where the UKBB bulk .zip files are being held.")
	flag.StringVar(&filetypes, "type", "dicomzip", "File type. Options include 'dicomzip' (default), '12leadekg', and 'exerciseekg' (for EKG data).")
	flag.StringVar(&output, "output", "", "Output file. If blank, output will go to STDOUT.")
	flag.StringVar(&fileList, "files", "", "Optional one-column headerless list of files to process. If set, will only process these fils rather than all available files under the path.")
	flag.Parse()

	if path == "" && fileList == "" {
		flag.Usage()
		os.Exit(1)
	}

	// Replace the output target with a file, if desired
	if output != "" {
		outF, err := os.Create(genomisc.ExpandHome(output))
		if err != nil {
			log.Fatalln(err)
		}
		defer outF.Close()

		STDOUT = bufio.NewWriterSize(outF, BufferSize)
		defer STDOUT.Flush()
	}

	if filetypes == "exerciseekg" {
		if fileList != "" {
			log.Fatalln("file list not yet implemented for exerciseekg file type")
		}

		if err := ManifestForExerciseEKG(path); err != nil {
			log.Fatalln(err)
		}

		return
	}

	if filetypes == "12leadekg" {
		if fileList != "" {
			log.Fatalln("file list not yet implemented for 12leadekg file type")
		}
		if err := ManifestFor12LeadEKG(path); err != nil {
			log.Fatalln(err)
		}

		return
	}

	if filetypes != "dicomzip" {
		log.Printf("Requested filetype '%s' not recognized\n", filetypes)
		flag.PrintDefaults()
		os.Exit(1)
	}

	if err := ManifestForDicom(path, fileList); err != nil {
		log.Fatalln(err)
	}
}
// Makes one big combined manifest
// Emits to stdout
Makes one big combined manifest
Emits to stdout
// Makes one big combined manifest // Emits to stdout
func main() {
	defer STDOUT.Flush()
	var path, output, fileList string
	var filetypes string
	flag.StringVar(&path, "path", "", "Path where the UKBB bulk .zip files are being held.")
	flag.StringVar(&filetypes, "type", "dicomzip", "File type. Options include 'dicomzip' (default), '12leadekg', and 'exerciseekg' (for EKG data).")
	flag.StringVar(&output, "output", "", "Output file. If blank, output will go to STDOUT.")
	flag.StringVar(&fileList, "files", "", "Optional one-column headerless list of files to process. If set, will only process these fils rather than all available files under the path.")
	flag.Parse()
	if path == "" && fileList == "" {
		flag.Usage()
		os.Exit(1)
	}
	if output != "" {
		outF, err := os.Create(genomisc.ExpandHome(output))
		if err != nil {
			log.Fatalln(err)
		}
		defer outF.Close()
		STDOUT = bufio.NewWriterSize(outF, BufferSize)
		defer STDOUT.Flush()
	}
	if filetypes == "exerciseekg" {
		if fileList != "" {
			log.Fatalln("file list not yet implemented for exerciseekg file type")
		}
		if err := ManifestForExerciseEKG(path); err != nil {
			log.Fatalln(err)
		}
		return
	}
	if filetypes == "12leadekg" {
		if fileList != "" {
			log.Fatalln("file list not yet implemented for 12leadekg file type")
		}
		if err := ManifestFor12LeadEKG(path); err != nil {
			log.Fatalln(err)
		}
		return
	}
	if filetypes != "dicomzip" {
		log.Printf("Requested filetype '%s' not recognized\n", filetypes)
		flag.PrintDefaults()
		os.Exit(1)
	}
	if err := ManifestForDicom(path, fileList); err != nil {
		log.Fatalln(err)
	}
}
func main ( ) { defer STDOUT . Flush ( ) var path , output , fileList string var filetypes string flag . StringVar ( & path , " " , " " , " " ) flag . StringVar ( & filetypes , " " , " " , " " ) flag . StringVar ( & output , " " , " " , " " ) flag . StringVar ( & fileList , " " , " " , " " ) flag . Parse ( ) if path == " " && fileList == " " { flag . Usage ( ) os . Exit ( 1 ) } if output != " " { outF , err := os . Create ( genomisc . ExpandHome ( output ) ) if err != nil { log . Fatalln ( err ) } defer outF . Close ( ) STDOUT = bufio . NewWriterSize ( outF , BufferSize ) defer STDOUT . Flush ( ) } if filetypes == " " { if fileList != " " { log . Fatalln ( " " ) } if err := ManifestForExerciseEKG ( path ) ; err != nil { log . Fatalln ( err ) } return } if filetypes == " " { if fileList != " " { log . Fatalln ( " " ) } if err := ManifestFor12LeadEKG ( path ) ; err != nil { log . Fatalln ( err ) } return } if filetypes != " " { log . Printf ( " \n " , filetypes ) flag . PrintDefaults ( ) os . Exit ( 1 ) } if err := ManifestForDicom ( path , fileList ) ; err != nil { log . Fatalln ( err ) } }
Makes one big combined manifest
Emits to stdout
Makes one big combined manifest Emits to stdout
// Replace the output target with a file, if desired