@gmod/bed 2.1.2 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
- ## [2.1.2](https://github.com/GMOD/bed-js/compare/v2.1.1...v2.1.2) (2022-07-24)
1
+ ## [2.1.4](https://github.com/GMOD/bed-js/compare/v2.1.3...v2.1.4) (2025-05-13)
2
+
3
+
2
4
 
5
+ ## [2.1.3](https://github.com/GMOD/bed-js/compare/v2.1.2...v2.1.3) (2024-3-25)
3
6
 
7
+ - Fix autoSql with comments in column names
8
+
9
+ ## [2.1.2](https://github.com/GMOD/bed-js/compare/v2.1.1...v2.1.2) (2022-07-24)
4
10
 
5
11
  - Add comment string to autoSql types
6
12
 
@@ -30,7 +36,8 @@
30
36
 
31
37
  ## [2.0.4](https://github.com/GMOD/bed-js/compare/v2.0.3...v2.0.4) (2020-12-03)
32
38
 
33
- - Allow for badly formatted comments not entirely within a quote, was exhibited by https://hgdownload.soe.ucsc.edu/gbdb/hg19/gnomAD/pLI/pliByGene.bb
39
+ - Allow for badly formatted comments not entirely within a quote, was exhibited
40
+ by https://hgdownload.soe.ucsc.edu/gbdb/hg19/gnomAD/pLI/pliByGene.bb
34
41
 
35
42
  ## [2.0.3](https://github.com/GMOD/bed-js/compare/v2.0.2...v2.0.3) (2020-07-09)
36
43
 
@@ -40,7 +47,8 @@
40
47
 
41
48
  ## [2.0.2](https://github.com/GMOD/bed-js/compare/v2.0.1...v2.0.2) (2019-11-12)
42
49
 
43
- - Small autoSql grammar improvements e.g. allow \_ in autoSql names (for `_mouseover` from ucsc)
50
+ - Small autoSql grammar improvements e.g. allow \_ in autoSql names (for
51
+ `_mouseover` from ucsc)
44
52
 
45
53
  <a name="2.0.1"></a>
46
54
 
@@ -54,13 +62,17 @@
54
62
 
55
63
  - API now processes just text lines with the parseLine method
56
64
  - Remove snake case of results
57
- - Returned values match autoSql very faithfully and uses the naming from UCSC e.g. exact strings from autoSql {chrom, chromStart, chromEnd}
58
- - Accepts a opts.uniqueId for the parseLine method which adds this to the featureData
59
- - Parses the default BED schema with a defaultBedSchema.as autoSql definition instead of a separate method
65
+ - Returned values match autoSql very faithfully and uses the naming from UCSC
66
+ e.g. exact strings from autoSql {chrom, chromStart, chromEnd}
67
+ - Accepts a opts.uniqueId for the parseLine method which adds this to the
68
+ featureData
69
+ - Parses the default BED schema with a defaultBedSchema.as autoSql definition
70
+ instead of a separate method
60
71
 
61
72
  ## [1.0.4](https://github.com/GMOD/bed-js/compare/v1.0.3...v1.0.4) (2019-04-14)
62
73
 
63
- - Changed parseBedText to accept an Options argument with offset and optionally a uniqueId
74
+ - Changed parseBedText to accept an Options argument with offset and optionally
75
+ a uniqueId
64
76
 
65
77
  ## [1.0.3](https://github.com/GMOD/bed-js/compare/v1.0.2...v1.0.3) (2019-04-02)
66
78
 
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # bed-js
2
2
 
3
3
  [![Coverage Status](https://img.shields.io/codecov/c/github/GMOD/bed-js/master.svg?style=flat-square)](https://codecov.io/gh/GMOD/bed-js/branch/master)
4
- [![Build Status](https://img.shields.io/github/workflow/status/GMOD/bed-js/Push/master?logo=github&style=flat-query)](https://github.com/GMOD/bed-js/actions?query=branch%3Amaster+workflow%3APush+)
4
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/GMOD/bed-js/push.yml?branch=master)](https://github.com/GMOD/bed-js/actions)
5
5
 
6
6
  Performs parsing of BED files including autoSql
7
7
 
@@ -43,7 +43,8 @@ The predefined types can include
43
43
  mafFrames
44
44
  mafSummary
45
45
 
46
- If neither autoSql or type is specified, the default BED schema is used (see [here](src/as/defaultBedSchema.as))
46
+ If neither autoSql or type is specified, the default BED schema is used (see
47
+ [here](src/as/defaultBedSchema.as))
47
48
 
48
49
  ### parseLine(line, opts)
49
50
 
@@ -55,11 +56,13 @@ Parses a BED line according to the currently loaded schema
55
56
 
56
57
  An Options object can contain
57
58
 
58
- - opts.uniqueId - an indication of a uniqueId that is not encoded by the BED line itself
59
+ - opts.uniqueId - an indication of a uniqueId that is not encoded by the BED
60
+ line itself
59
61
 
60
62
  The default instantiation of the parser with new BED() simply parses lines
61
- assuming the fields come from the standard BED schema.
62
- Your line can just contain just a subset of the fields e.g. `chrom, chromStart, chromEnd, name, score`
63
+ assuming the fields come from the standard BED schema. Your line can just
64
+ contain just a subset of the fields e.g.
65
+ `chrom, chromStart, chromEnd, name, score`
63
66
 
64
67
  ## Examples
65
68
 
@@ -74,7 +77,8 @@ p.parseLine('chr1\t0\t100')
74
77
 
75
78
  ### Parsing BED with a built in schema e.g. bigGenePred
76
79
 
77
- If you have a BED format that corresponds to a different schema, you can specify from the list of default built in schemas
80
+ If you have a BED format that corresponds to a different schema, you can specify
81
+ from the list of default built in schemas
78
82
 
79
83
  Specify this in the opts.type for the BED constructor
80
84
 
@@ -124,8 +128,8 @@ p.parseLine(line)
124
128
 
125
129
  ### Important notes
126
130
 
127
- - Does not parse "browser" or "track" lines and will throw an error if
128
- parseLine receives one of these
131
+ - Does not parse "browser" or "track" lines and will throw an error if parseLine
132
+ receives one of these
129
133
  - By default, parseLine parses only tab delimited text, if you want to use
130
134
  spaces as is allowed by UCSC then pass an array to `line` for parseLine
131
135
  - Converts strand from {+,-,.} to {1,-1,0} and also sets strand 0 even if no
@@ -142,6 +146,8 @@ be linked from [jbrowse.org](http://jbrowse.org).
142
146
 
143
147
  MIT © [Colin Diesh](https://github.com/cmdcolin)
144
148
 
145
- based on https://genome-source.gi.ucsc.edu/gitlist/kent.git/blob/master/src/hg/autoSql/autoSql.doc
149
+ based on
150
+ https://genome-source.gi.ucsc.edu/gitlist/kent.git/blob/master/src/hg/autoSql/autoSql.doc
146
151
 
147
- also see http://genomewiki.ucsc.edu/index.php/AutoSql and https://www.linuxjournal.com/article/5949
152
+ also see http://genomewiki.ucsc.edu/index.php/AutoSql and
153
+ https://www.linuxjournal.com/article/5949
@@ -1,14 +1,173 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mafSummary = exports.mafFrames = exports.defaultBedSchema = exports.bigPsl = exports.bigNarrowPeak = exports.bigMaf = exports.bigLink = exports.bigInteract = exports.bigGenePred = exports.bigChain = void 0;
4
- exports.bigChain = "table bigChain\n\"bigChain pairwise alignment\"\n (\n string chrom; \"Reference sequence chromosome or scaffold\"\n uint chromStart; \"Start position in chromosome\"\n uint chromEnd; \"End position in chromosome\"\n string name; \"Name or ID of item, ideally both human readable and unique\"\n uint score; \"Score (0-1000)\"\n char[1] strand; \"+ or - for strand\"\n uint tSize; \"size of target sequence\"\n string qName; \"name of query sequence\"\n uint qSize; \"size of query sequence\"\n uint qStart; \"start of alignment on query sequence\"\n uint qEnd; \"end of alignment on query sequence\"\n uint chainScore; \"score from chain\"\n )";
5
- exports.bigGenePred = "table bigGenePred\n\"bigGenePred gene models\"\n (\n string chrom; \"Reference sequence chromosome or scaffold\"\n uint chromStart; \"Start position in chromosome\"\n uint chromEnd; \"End position in chromosome\"\n string name; \"Name or ID of item, ideally both human readable and unique\"\n uint score; \"Score (0-1000)\"\n char[1] strand; \"+ or - for strand\"\n uint thickStart; \"Start of where display should be thick (start codon)\"\n uint thickEnd; \"End of where display should be thick (stop codon)\"\n uint reserved; \"RGB value (use R,G,B string in input file)\"\n int blockCount; \"Number of blocks\"\n int[blockCount] blockSizes; \"Comma separated list of block sizes\"\n int[blockCount] chromStarts; \"Start positions relative to chromStart\"\n string name2; \"Alternative/human readable name\"\n string cdsStartStat; \"Status of CDS start annotation (none, unknown, incomplete, or complete)\"\n string cdsEndStat; \"Status of CDS end annotation (none, unknown, incomplete, or complete)\"\n int[blockCount] exonFrames; \"Exon frame {0,1,2}, or -1 if no frame for exon\"\n string type; \"Transcript type\"\n string geneName; \"Primary identifier for gene\"\n string geneName2; \"Alternative/human readable gene name\"\n string geneType; \"Gene type\"\n )";
6
- exports.bigInteract = "table interact\n\"interaction between two regions\"\n (\n string chrom; \"Chromosome (or contig, scaffold, etc.). For interchromosomal, use 2 records\"\n uint chromStart; \"Start position of lower region. For interchromosomal, set to chromStart of this region\"\n uint chromEnd; \"End position of upper region. For interchromosomal, set to chromEnd of this region\"\n string name; \"Name of item, for display. Usually 'sourceName/targetName/exp' or empty\"\n uint score; \"Score (0-1000)\"\n double value; \"Strength of interaction or other data value. Typically basis for score\"\n string exp; \"Experiment name (metadata for filtering). Use . if not applicable\"\n string color; \"Item color. Specified as r,g,b or hexadecimal #RRGGBB or html color name, as in //www.w3.org/TR/css3-color/#html4. Use 0 and spectrum setting to shade by score\"\n string sourceChrom; \"Chromosome of source region (directional) or lower region. For non-directional interchromosomal, chrom of this region.\"\n uint sourceStart; \"Start position in chromosome of source/lower/this region\"\n uint sourceEnd; \"End position in chromosome of source/lower/this region\"\n string sourceName; \"Identifier of source/lower/this region\"\n string sourceStrand; \"Orientation of source/lower/this region: + or -. Use . if not applicable\"\n string targetChrom; \"Chromosome of target region (directional) or upper region. For non-directional interchromosomal, chrom of other region\"\n uint targetStart; \"Start position in chromosome of target/upper/this region\"\n uint targetEnd; \"End position in chromosome of target/upper/this region\"\n string targetName; \"Identifier of target/upper/this region\"\n string targetStrand; \"Orientation of target/upper/this region: + or -. Use . if not applicable\"\n\n )";
7
- exports.bigLink = "table bigLink\n\"bigLink pairwise alignment\"\n (\n string chrom; \"Reference sequence chromosome or scaffold\"\n uint chromStart; \"Start position in chromosome\"\n uint chromEnd; \"End position in chromosome\"\n string name; \"Name or ID of item, ideally both human readable and unique\"\n uint qStart; \"start of alignment on query sequence\"\n )";
8
- exports.bigMaf = "table bedMaf\n\"Bed3 with MAF block\"\n (\n string chrom; \"Reference sequence chromosome or scaffold\"\n uint chromStart; \"Start position in chromosome\"\n uint chromEnd; \"End position in chromosome\"\n lstring mafBlock; \"MAF block\"\n )";
9
- exports.bigNarrowPeak = "table bigNarrowPeak\n\"BED6+4 Peaks of signal enrichment based on pooled, normalized (interpreted) data.\"\n(\n string chrom; \"Reference sequence chromosome or scaffold\"\n uint chromStart; \"Start position in chromosome\"\n uint chromEnd; \"End position in chromosome\"\n string name;\t \"Name given to a region (preferably unique). Use . if no name is assigned\"\n uint score; \"Indicates how dark the peak will be displayed in the browser (0-1000) \"\n char[1] strand; \"+ or - or . for unknown\"\n float signalValue; \"Measurement of average enrichment for the region\"\n float pValue; \"Statistical significance of signal value (-log10). Set to -1 if not used.\"\n float qValue; \"Statistical significance with multiple-test correction applied (FDR -log10). Set to -1 if not used.\"\n int peak; \"Point-source called for this peak; 0-based offset from chromStart. Set to -1 if no point-source called.\"\n)";
10
- exports.bigPsl = "table bigPsl\n\"bigPsl pairwise alignment\"\n (\n string chrom; \"Reference sequence chromosome or scaffold\"\n uint chromStart; \"Start position in chromosome\"\n uint chromEnd; \"End position in chromosome\"\n string name; \"Name or ID of item, ideally both human readable and unique\"\n uint score; \"Score (0-1000)\"\n char[1] strand; \"+ or - indicates whether the query aligns to the + or - strand on the reference\"\n uint thickStart; \"Start of where display should be thick (start codon)\"\n uint thickEnd; \"End of where display should be thick (stop codon)\"\n uint reserved; \"RGB value (use R,G,B string in input file)\"\n int blockCount; \"Number of blocks\"\n int[blockCount] blockSizes; \"Comma separated list of block sizes\"\n int[blockCount] chromStarts; \"Start positions relative to chromStart\"\n\n uint oChromStart;\"Start position in other chromosome\"\n uint oChromEnd; \"End position in other chromosome\"\n char[1] oStrand; \"+ or -, - means that psl was reversed into BED-compatible coordinates\"\n uint oChromSize; \"Size of other chromosome.\"\n int[blockCount] oChromStarts; \"Start positions relative to oChromStart or from oChromStart+oChromSize depending on strand\"\n\n lstring oSequence; \"Sequence on other chrom (or empty)\"\n string oCDS; \"CDS in NCBI format\"\n\n uint chromSize;\"Size of target chromosome\"\n\n uint match; \"Number of bases matched.\"\n uint misMatch; \" Number of bases that don't match \"\n uint repMatch; \" Number of bases that match but are part of repeats \"\n uint nCount; \" Number of 'N' bases \"\n uint seqType; \"0=empty, 1=nucleotide, 2=amino_acid\"\n )";
11
- exports.defaultBedSchema = "table defaultBedSchema\n\"BED12\"\n (\n string chrom; \"The name of the chromosome (e.g. chr3, chrY, chr2_random) or scaffold (e.g. scaffold10671).\"\n uint chromStart; \"The starting position of the feature in the chromosome or scaffold. The first base in a chromosome is numbered 0.\"\n uint chromEnd; \"The ending position of the feature in the chromosome or scaffold. The chromEnd base is not included in the display of the feature. For example, the first 100 bases of a chromosome are defined as chromStart=0, chromEnd=100, and span the bases numbered 0-99.\"\n string name; \"Defines the name of the BED line.\"\n float score; \"Feature score, doesn't care about the 0-1000 limit as in bed\"\n char strand; \"Defines the strand. Either '.' (=no strand) or '+' or '-'\"\n uint thickStart; \"The starting position at which the feature is drawn thickly (for example, the start codon in gene displays). When there is no thick part, thickStart and thickEnd are usually set to the chromStart position.\"\n uint thickEnd; \"The ending position at which the feature is drawn thickly (for example the stop codon in gene displays).\"\n string itemRgb; \"An RGB value of the form R,G,B (e.g. 255,0,0). \"\n uint blockCount; \" The number of blocks (exons) in the BED line.\"\n uint[blockCount] blockSizes; \" A comma-separated list of the block sizes. The number of items in this list should correspond to blockCount.\"\n uint[blockCount] blockStarts; \"A comma-separated list of block starts. All of the blockStart positions should be calculated relative to chromStart. The number of items in this list should correspond to blockCount.\"\n )";
12
- exports.mafFrames = "table mafFrames\n\"codon frame assignment for MAF components\"\n (\n string chrom; \"Reference sequence chromosome or scaffold\"\n uint chromStart; \"Start range in chromosome\"\n uint chromEnd; \"End range in chromosome\"\n string src; \"Name of sequence source in MAF\"\n ubyte frame; \"frame (0,1,2) for first base(+) or last bast(-)\"\n char[1] strand; \"+ or -\"\n string name; \"Name of gene used to define frame\"\n int prevFramePos; \"target position of the previous base (in transcription direction) that continues this frame, or -1 if none, or frame not contiguous\"\n int nextFramePos; \"target position of the next base (in transcription direction) that continues this frame, or -1 if none, or frame not contiguous\"\n ubyte isExonStart; \"does this start the CDS portion of an exon?\"\n ubyte isExonEnd; \"does this end the CDS portion of an exon?\"\n )";
13
- exports.mafSummary = "table mafSummary\n\"Positions and scores for alignment blocks\"\n (\n string chrom; \"Reference sequence chromosome or scaffold\"\n uint chromStart; \"Start position in chromosome\"\n uint chromEnd; \"End position in chromosome\"\n string src; \"Sequence name or database of alignment\"\n float score; \"Floating point score.\"\n char[1] leftStatus; \"Gap/break annotation for preceding block\"\n char[1] rightStatus; \"Gap/break annotation for following block\"\n )";
4
+ exports.bigChain = `table bigChain
5
+ "bigChain pairwise alignment"
6
+ (
7
+ string chrom; "Reference sequence chromosome or scaffold"
8
+ uint chromStart; "Start position in chromosome"
9
+ uint chromEnd; "End position in chromosome"
10
+ string name; "Name or ID of item, ideally both human readable and unique"
11
+ uint score; "Score (0-1000)"
12
+ char[1] strand; "+ or - for strand"
13
+ uint tSize; "size of target sequence"
14
+ string qName; "name of query sequence"
15
+ uint qSize; "size of query sequence"
16
+ uint qStart; "start of alignment on query sequence"
17
+ uint qEnd; "end of alignment on query sequence"
18
+ uint chainScore; "score from chain"
19
+ )`;
20
+ exports.bigGenePred = `table bigGenePred
21
+ "bigGenePred gene models"
22
+ (
23
+ string chrom; "Reference sequence chromosome or scaffold"
24
+ uint chromStart; "Start position in chromosome"
25
+ uint chromEnd; "End position in chromosome"
26
+ string name; "Name or ID of item, ideally both human readable and unique"
27
+ uint score; "Score (0-1000)"
28
+ char[1] strand; "+ or - for strand"
29
+ uint thickStart; "Start of where display should be thick (start codon)"
30
+ uint thickEnd; "End of where display should be thick (stop codon)"
31
+ uint reserved; "RGB value (use R,G,B string in input file)"
32
+ int blockCount; "Number of blocks"
33
+ int[blockCount] blockSizes; "Comma separated list of block sizes"
34
+ int[blockCount] chromStarts; "Start positions relative to chromStart"
35
+ string name2; "Alternative/human readable name"
36
+ string cdsStartStat; "Status of CDS start annotation (none, unknown, incomplete, or complete)"
37
+ string cdsEndStat; "Status of CDS end annotation (none, unknown, incomplete, or complete)"
38
+ int[blockCount] exonFrames; "Exon frame {0,1,2}, or -1 if no frame for exon"
39
+ string type; "Transcript type"
40
+ string geneName; "Primary identifier for gene"
41
+ string geneName2; "Alternative/human readable gene name"
42
+ string geneType; "Gene type"
43
+ )`;
44
+ exports.bigInteract = `table interact
45
+ "interaction between two regions"
46
+ (
47
+ string chrom; "Chromosome (or contig, scaffold, etc.). For interchromosomal, use 2 records"
48
+ uint chromStart; "Start position of lower region. For interchromosomal, set to chromStart of this region"
49
+ uint chromEnd; "End position of upper region. For interchromosomal, set to chromEnd of this region"
50
+ string name; "Name of item, for display. Usually 'sourceName/targetName/exp' or empty"
51
+ uint score; "Score (0-1000)"
52
+ double value; "Strength of interaction or other data value. Typically basis for score"
53
+ string exp; "Experiment name (metadata for filtering). Use . if not applicable"
54
+ string color; "Item color. Specified as r,g,b or hexadecimal #RRGGBB or html color name, as in //www.w3.org/TR/css3-color/#html4. Use 0 and spectrum setting to shade by score"
55
+ string sourceChrom; "Chromosome of source region (directional) or lower region. For non-directional interchromosomal, chrom of this region."
56
+ uint sourceStart; "Start position in chromosome of source/lower/this region"
57
+ uint sourceEnd; "End position in chromosome of source/lower/this region"
58
+ string sourceName; "Identifier of source/lower/this region"
59
+ string sourceStrand; "Orientation of source/lower/this region: + or -. Use . if not applicable"
60
+ string targetChrom; "Chromosome of target region (directional) or upper region. For non-directional interchromosomal, chrom of other region"
61
+ uint targetStart; "Start position in chromosome of target/upper/this region"
62
+ uint targetEnd; "End position in chromosome of target/upper/this region"
63
+ string targetName; "Identifier of target/upper/this region"
64
+ string targetStrand; "Orientation of target/upper/this region: + or -. Use . if not applicable"
65
+
66
+ )`;
67
+ exports.bigLink = `table bigLink
68
+ "bigLink pairwise alignment"
69
+ (
70
+ string chrom; "Reference sequence chromosome or scaffold"
71
+ uint chromStart; "Start position in chromosome"
72
+ uint chromEnd; "End position in chromosome"
73
+ string name; "Name or ID of item, ideally both human readable and unique"
74
+ uint qStart; "start of alignment on query sequence"
75
+ )`;
76
+ exports.bigMaf = `table bedMaf
77
+ "Bed3 with MAF block"
78
+ (
79
+ string chrom; "Reference sequence chromosome or scaffold"
80
+ uint chromStart; "Start position in chromosome"
81
+ uint chromEnd; "End position in chromosome"
82
+ lstring mafBlock; "MAF block"
83
+ )`;
84
+ exports.bigNarrowPeak = `table bigNarrowPeak
85
+ "BED6+4 Peaks of signal enrichment based on pooled, normalized (interpreted) data."
86
+ (
87
+ string chrom; "Reference sequence chromosome or scaffold"
88
+ uint chromStart; "Start position in chromosome"
89
+ uint chromEnd; "End position in chromosome"
90
+ string name; "Name given to a region (preferably unique). Use . if no name is assigned"
91
+ uint score; "Indicates how dark the peak will be displayed in the browser (0-1000) "
92
+ char[1] strand; "+ or - or . for unknown"
93
+ float signalValue; "Measurement of average enrichment for the region"
94
+ float pValue; "Statistical significance of signal value (-log10). Set to -1 if not used."
95
+ float qValue; "Statistical significance with multiple-test correction applied (FDR -log10). Set to -1 if not used."
96
+ int peak; "Point-source called for this peak; 0-based offset from chromStart. Set to -1 if no point-source called."
97
+ )`;
98
+ exports.bigPsl = `table bigPsl
99
+ "bigPsl pairwise alignment"
100
+ (
101
+ string chrom; "Reference sequence chromosome or scaffold"
102
+ uint chromStart; "Start position in chromosome"
103
+ uint chromEnd; "End position in chromosome"
104
+ string name; "Name or ID of item, ideally both human readable and unique"
105
+ uint score; "Score (0-1000)"
106
+ char[1] strand; "+ or - indicates whether the query aligns to the + or - strand on the reference"
107
+ uint thickStart; "Start of where display should be thick (start codon)"
108
+ uint thickEnd; "End of where display should be thick (stop codon)"
109
+ uint reserved; "RGB value (use R,G,B string in input file)"
110
+ int blockCount; "Number of blocks"
111
+ int[blockCount] blockSizes; "Comma separated list of block sizes"
112
+ int[blockCount] chromStarts; "Start positions relative to chromStart"
113
+
114
+ uint oChromStart;"Start position in other chromosome"
115
+ uint oChromEnd; "End position in other chromosome"
116
+ char[1] oStrand; "+ or -, - means that psl was reversed into BED-compatible coordinates"
117
+ uint oChromSize; "Size of other chromosome."
118
+ int[blockCount] oChromStarts; "Start positions relative to oChromStart or from oChromStart+oChromSize depending on strand"
119
+
120
+ lstring oSequence; "Sequence on other chrom (or empty)"
121
+ string oCDS; "CDS in NCBI format"
122
+
123
+ uint chromSize;"Size of target chromosome"
124
+
125
+ uint match; "Number of bases matched."
126
+ uint misMatch; " Number of bases that don't match "
127
+ uint repMatch; " Number of bases that match but are part of repeats "
128
+ uint nCount; " Number of 'N' bases "
129
+ uint seqType; "0=empty, 1=nucleotide, 2=amino_acid"
130
+ )`;
131
+ exports.defaultBedSchema = `table defaultBedSchema
132
+ "BED12"
133
+ (
134
+ string chrom; "The name of the chromosome (e.g. chr3, chrY, chr2_random) or scaffold (e.g. scaffold10671)."
135
+ uint chromStart; "The starting position of the feature in the chromosome or scaffold. The first base in a chromosome is numbered 0."
136
+ uint chromEnd; "The ending position of the feature in the chromosome or scaffold. The chromEnd base is not included in the display of the feature. For example, the first 100 bases of a chromosome are defined as chromStart=0, chromEnd=100, and span the bases numbered 0-99."
137
+ string name; "Defines the name of the BED line."
138
+ float score; "Feature score, doesn't care about the 0-1000 limit as in bed"
139
+ char strand; "Defines the strand. Either '.' (=no strand) or '+' or '-'"
140
+ uint thickStart; "The starting position at which the feature is drawn thickly (for example, the start codon in gene displays). When there is no thick part, thickStart and thickEnd are usually set to the chromStart position."
141
+ uint thickEnd; "The ending position at which the feature is drawn thickly (for example the stop codon in gene displays)."
142
+ string itemRgb; "An RGB value of the form R,G,B (e.g. 255,0,0). "
143
+ uint blockCount; " The number of blocks (exons) in the BED line."
144
+ uint[blockCount] blockSizes; " A comma-separated list of the block sizes. The number of items in this list should correspond to blockCount."
145
+ uint[blockCount] blockStarts; "A comma-separated list of block starts. All of the blockStart positions should be calculated relative to chromStart. The number of items in this list should correspond to blockCount."
146
+ )`;
147
+ exports.mafFrames = `table mafFrames
148
+ "codon frame assignment for MAF components"
149
+ (
150
+ string chrom; "Reference sequence chromosome or scaffold"
151
+ uint chromStart; "Start range in chromosome"
152
+ uint chromEnd; "End range in chromosome"
153
+ string src; "Name of sequence source in MAF"
154
+ ubyte frame; "frame (0,1,2) for first base(+) or last bast(-)"
155
+ char[1] strand; "+ or -"
156
+ string name; "Name of gene used to define frame"
157
+ int prevFramePos; "target position of the previous base (in transcription direction) that continues this frame, or -1 if none, or frame not contiguous"
158
+ int nextFramePos; "target position of the next base (in transcription direction) that continues this frame, or -1 if none, or frame not contiguous"
159
+ ubyte isExonStart; "does this start the CDS portion of an exon?"
160
+ ubyte isExonEnd; "does this end the CDS portion of an exon?"
161
+ )`;
162
+ exports.mafSummary = `table mafSummary
163
+ "Positions and scores for alignment blocks"
164
+ (
165
+ string chrom; "Reference sequence chromosome or scaffold"
166
+ uint chromStart; "Start position in chromosome"
167
+ uint chromEnd; "End position in chromosome"
168
+ string src; "Sequence name or database of alignment"
169
+ float score; "Floating point score."
170
+ char[1] leftStatus; "Gap/break annotation for preceding block"
171
+ char[1] rightStatus; "Gap/break annotation for following block"
172
+ )`;
14
173
  //# sourceMappingURL=autoSqlSchemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"autoSqlSchemas.js","sourceRoot":"","sources":["../../src/as/autoSqlSchemas.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG,wvBAelB,CAAA;AAEO,QAAA,WAAW,GAAG,42CAuBtB,CAAA;AAEQ,QAAA,WAAW,GAAG,y4DAsBrB,CAAA;AAEO,QAAA,OAAO,GAAG,gZAQjB,CAAA;AAEO,QAAA,MAAM,GAAG,kRAOhB,CAAA;AACO,QAAA,aAAa,GAAG,w+BAa3B,CAAA;AACW,QAAA,MAAM,GAAG,qwDAgChB,CAAA;AAEO,QAAA,gBAAgB,GAAG,wqDAe1B,CAAA;AAEO,QAAA,SAAS,GAAG,07BAcnB,CAAA;AAEO,QAAA,UAAU,GAAG,wgBAUpB,CAAA"}
1
+ {"version":3,"file":"autoSqlSchemas.js","sourceRoot":"","sources":["../../src/as/autoSqlSchemas.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;;;;;;;;;;;;;;;MAelB,CAAA;AAEO,QAAA,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;KAuBtB,CAAA;AAEQ,QAAA,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;MAsBrB,CAAA;AAEO,QAAA,OAAO,GAAG;;;;;;;;MAQjB,CAAA;AAEO,QAAA,MAAM,GAAG;;;;;;;MAOhB,CAAA;AACO,QAAA,aAAa,GAAG;;;;;;;;;;;;;EAa3B,CAAA;AACW,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgChB,CAAA;AAEO,QAAA,gBAAgB,GAAG;;;;;;;;;;;;;;;MAe1B,CAAA;AAEO,QAAA,SAAS,GAAG;;;;;;;;;;;;;;MAcnB,CAAA;AAEO,QAAA,UAAU,GAAG;;;;;;;;;;MAUpB,CAAA"}
@@ -15,21 +15,29 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
- var autoSql_1 = require("./autoSql");
27
- var types = __importStar(require("./as/autoSqlSchemas"));
28
- exports.default = Object.fromEntries(Object.entries(types).map(function (_a) {
29
- var key = _a[0], val = _a[1];
30
- return [
31
- key,
32
- (0, autoSql_1.parse)(val.trim()),
33
- ];
34
- }));
36
+ // @ts-expect-error
37
+ const autoSql_1 = require("./autoSql");
38
+ const types = __importStar(require("./as/autoSqlSchemas"));
39
+ exports.default = Object.fromEntries(Object.entries(types).map(([key, value]) => [
40
+ key,
41
+ (0, autoSql_1.parse)(value.trim()),
42
+ ]));
35
43
  //# sourceMappingURL=defaultTypes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaultTypes.js","sourceRoot":"","sources":["../src/defaultTypes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAiC;AAEjC,yDAA4C;AAE5C,kBAAe,MAAM,CAAC,WAAW,CAC/B,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,UAAC,EAAU;QAAT,GAAG,QAAA,EAAE,GAAG,QAAA;IAAM,OAAA;QACxC,GAAG;QACH,IAAA,eAAK,EAAC,GAAG,CAAC,IAAI,EAAE,CAAqB;KACtC;AAHyC,CAGzC,CAAC,CACH,CAAA"}
1
+ {"version":3,"file":"defaultTypes.js","sourceRoot":"","sources":["../src/defaultTypes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mBAAmB;AACnB,uCAAiC;AAEjC,2DAA4C;AAE5C,kBAAe,MAAM,CAAC,WAAW,CAC/B,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;IAC1C,GAAG;IACH,IAAA,eAAK,EAAC,KAAK,CAAC,IAAI,EAAE,CAAqB;CACxC,CAAC,CACH,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,2 +1 @@
1
- import BED from './parser';
2
- export default BED;
1
+ export { default } from './parser';
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var parser_1 = __importDefault(require("./parser"));
7
- exports.default = parser_1.default;
6
+ exports.default = void 0;
7
+ var parser_1 = require("./parser");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(parser_1).default; } });
8
9
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,oDAA0B;AAE1B,kBAAe,gBAAG,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAkC;AAAzB,kHAAA,OAAO,OAAA"}
@@ -0,0 +1 @@
1
+ {"type": "commonjs"}
package/dist/parser.d.ts CHANGED
@@ -2,13 +2,11 @@ import { AutoSqlSchema } from './util';
2
2
  export default class BED {
3
3
  autoSql: AutoSqlSchema;
4
4
  private attemptDefaultBed?;
5
- constructor(args?: {
5
+ constructor(arguments_?: {
6
6
  autoSql?: string;
7
7
  type?: string;
8
8
  });
9
- parseLine(line: string | string[], opts?: {
9
+ parseLine(line: string | string[], options?: {
10
10
  uniqueId?: string;
11
- }): {
12
- [key: string]: any;
13
- };
11
+ }): Record<string, any>;
14
12
  }
package/dist/parser.js CHANGED
@@ -3,28 +3,30 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var autoSql_1 = __importDefault(require("./autoSql"));
7
- var defaultTypes_1 = __importDefault(require("./defaultTypes"));
8
- var util_1 = require("./util");
9
- var strandMap = { '.': 0, '-': -1, '+': 1 };
10
- // heuristic that a BED file is BED12 like...the number in col 10 is blockCount-like
6
+ // @ts-expect-error
7
+ const autoSql_1 = __importDefault(require("./autoSql"));
8
+ const defaultTypes_1 = __importDefault(require("./defaultTypes"));
9
+ const util_1 = require("./util");
10
+ const strandMap = { '.': 0, '-': -1, '+': 1 };
11
+ // heuristic that a BED file is BED12 like...the number in col 10 is
12
+ // blockCount-like
11
13
  function isBed12Like(fields) {
12
- var _a;
13
14
  return (fields.length >= 12 &&
14
- !Number.isNaN(parseInt(fields[9], 10)) &&
15
- ((_a = fields[10]) === null || _a === void 0 ? void 0 : _a.split(',').filter(function (f) { return !!f; }).length) === parseInt(fields[9], 10));
15
+ !Number.isNaN(Number.parseInt(fields[9], 10)) &&
16
+ fields[10]?.split(',').filter(f => !!f).length ===
17
+ Number.parseInt(fields[9], 10));
16
18
  }
17
- var BED = /** @class */ (function () {
18
- function BED(args) {
19
- if (args === void 0) { args = {}; }
20
- if (args.autoSql) {
21
- this.autoSql = (0, util_1.detectTypes)(autoSql_1.default.parse(args.autoSql));
19
+ class BED {
20
+ constructor(arguments_ = {}) {
21
+ if (arguments_.autoSql) {
22
+ this.autoSql = (0, util_1.detectTypes)(autoSql_1.default.parse(arguments_.autoSql));
22
23
  }
23
- else if (args.type) {
24
- if (!defaultTypes_1.default[args.type]) {
24
+ else if (arguments_.type) {
25
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
26
+ if (!defaultTypes_1.default[arguments_.type]) {
25
27
  throw new Error('Type not found');
26
28
  }
27
- this.autoSql = (0, util_1.detectTypes)(defaultTypes_1.default[args.type]);
29
+ this.autoSql = (0, util_1.detectTypes)(defaultTypes_1.default[arguments_.type]);
28
30
  }
29
31
  else {
30
32
  this.autoSql = (0, util_1.detectTypes)(defaultTypes_1.default.defaultBedSchema);
@@ -38,42 +40,42 @@ var BED = /** @class */ (function () {
38
40
  * @param opts - supply opts.uniqueId
39
41
  * @return a object representing a feature
40
42
  */
41
- BED.prototype.parseLine = function (line, opts) {
42
- if (opts === void 0) { opts = {}; }
43
- var autoSql = this.autoSql;
44
- var uniqueId = opts.uniqueId;
45
- var fields = Array.isArray(line) ? line : line.split('\t');
46
- var feature = {};
43
+ parseLine(line, options = {}) {
44
+ const { autoSql } = this;
45
+ const { uniqueId } = options;
46
+ const fields = Array.isArray(line) ? line : line.split('\t');
47
+ let feature = {};
47
48
  if (!this.attemptDefaultBed ||
49
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
48
50
  (this.attemptDefaultBed && isBed12Like(fields))) {
49
- for (var i = 0; i < autoSql.fields.length; i++) {
50
- var autoField = autoSql.fields[i];
51
- var columnVal = fields[i];
52
- var isNumeric = autoField.isNumeric, isArray = autoField.isArray, arrayIsNumeric = autoField.arrayIsNumeric, name_1 = autoField.name;
53
- if (columnVal === null || columnVal === undefined) {
51
+ for (let index = 0; index < autoSql.fields.length; index++) {
52
+ const autoField = autoSql.fields[index];
53
+ let columnValue = fields[index];
54
+ const { isNumeric, isArray, arrayIsNumeric, name } = autoField;
55
+ if (columnValue === null || columnValue === undefined) {
54
56
  break;
55
57
  }
56
- if (columnVal !== '.') {
58
+ if (columnValue !== '.') {
57
59
  if (isNumeric) {
58
- var num = Number(columnVal);
59
- columnVal = Number.isNaN(num) ? columnVal : num;
60
+ const number_ = Number(columnValue);
61
+ columnValue = Number.isNaN(number_) ? columnValue : number_;
60
62
  }
61
63
  else if (isArray) {
62
- columnVal = columnVal.split(',');
63
- if (columnVal[columnVal.length - 1] === '') {
64
- columnVal.pop();
64
+ columnValue = columnValue.split(',');
65
+ if (columnValue.at(-1) === '') {
66
+ columnValue.pop();
65
67
  }
66
68
  if (arrayIsNumeric) {
67
- columnVal = columnVal.map(function (str) { return Number(str); });
69
+ columnValue = columnValue.map(Number);
68
70
  }
69
71
  }
70
- feature[name_1] = columnVal;
72
+ feature[name] = columnValue;
71
73
  }
72
74
  }
73
75
  }
74
76
  else {
75
- var fieldNames_1 = ['chrom', 'chromStart', 'chromEnd', 'name'];
76
- feature = Object.fromEntries(fields.map(function (f, i) { return [fieldNames_1[i] || 'field' + i, f]; }));
77
+ const fieldNames = ['chrom', 'chromStart', 'chromEnd', 'name'];
78
+ feature = Object.fromEntries(fields.map((f, index) => [fieldNames[index] || 'field' + index, f]));
77
79
  feature.chromStart = +feature.chromStart;
78
80
  feature.chromEnd = +feature.chromEnd;
79
81
  if (!Number.isNaN(Number.parseFloat(feature.field4))) {
@@ -91,8 +93,7 @@ var BED = /** @class */ (function () {
91
93
  feature.strand = strandMap[feature.strand] || 0;
92
94
  feature.chrom = decodeURIComponent(feature.chrom);
93
95
  return feature;
94
- };
95
- return BED;
96
- }());
96
+ }
97
+ }
97
98
  exports.default = BED;
98
99
  //# sourceMappingURL=parser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":";;;;;AAAA,sDAA8B;AAC9B,gEAAkC;AAClC,+BAAqE;AAErE,IAAM,SAAS,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAA;AAE7C,oFAAoF;AACpF,SAAS,WAAW,CAAC,MAAgB;;IACnC,OAAO,CACL,MAAM,CAAC,MAAM,IAAI,EAAE;QACnB,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACtC,CAAA,MAAA,MAAM,CAAC,EAAE,CAAC,0CAAE,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,EAAH,CAAG,EAAE,MAAM,MAAK,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAC3E,CAAA;AACH,CAAC;AACD;IAKE,aAAY,IAA8C;QAA9C,qBAAA,EAAA,SAA8C;QACxD,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,IAAI,CAAC,OAAO,GAAG,IAAA,kBAAW,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
20
- export declare type AutoSqlSchema = ReturnType<typeof detectTypes>;
20
+ export type AutoSqlSchema = ReturnType<typeof detectTypes>;