GenomeComb

tsv2bed

Format

cg tsv2bed ?infile? ?outfile?

Summary

Converts data in tab-separated format (tsv) format to bed format. By default it will create a minimal bed file by extracting chromosome,begin and end from the input using the default fields.

Arguments

infile
file to be converted, if not given (or -), uses stdin. File may be compressed.
outfile
write results to outfile, if not given, uses stdout

Options

-f fields (--fields)
list of fields in the tsv used for creating the bed file. You can use this option to add more than the three minimal fields and/or use other field names. If a field is empty (enclosed in {}), the default field name will be used. e.g.
cg tsv2bed --fields '{} {} {} name score' tsvfile bedfile

will add the name and score fields, taking the default columns for chromosome,begin,end

If the first (chromosome) field is not found in the header, it will be put as a value in the output, e.g.

cg tsv2bed --fields 'contig1 {} {} name score' tsvfile bedfile

will contain the value "contig1" for the first (chromosome) field in all output

Category

Format Conversion