FRAG format
This is an format for the fragment files defined by 10x genomics to
store the alignments from single-cell ATAC-seq experiment. It can be
regarded as the BEDPE format, containing the chromosome, the
leftmost position of aligned fragment, and the rightmost position of
the aligned fragment, with two extra columns – the barcode information and
the counts of the fragments aligned to the same location with the same
barcode. It is usually generated by the cellranger-atac or
cellranger-arc pipeline. But this is a fairly straightforward format
so one can easily convert other alignment results into this format. An
example of the fragment file is like:
chr22 10768839 10769063 AAACGAAAGACTCGGA 2
chr22 11333072 11333249 AAACGAAAGACTCGGA 1
chr22 11363891 11364010 AAACGAAAGACTCGGA 1
...
Fields must be separated by tabs. Plain, gzip and BGZF files are supported; the final record does not require a trailing newline. It receives the same validation and count cap as every other record. Malformed final records raise the usual parser error (for example, fewer than five columns or an end coordinate that does not follow the start).
Leading #, track and browser header lines are skipped, including when
the file contains only headers. The Python FragParser API raises
ValueError: No valid fragments found in FRAG input if a build has no
accepted fragments. An append with no accepted fragments raises the same
error when the parser has no prior fragments; otherwise it preserves that
parser’s statistics. Statistics belong to the parser instance, rather than
the supplied track. Records with a negative start or an empty chromosome
are skipped as before.