@jbrowse/plugin-gtf 2.6.1 → 2.6.3

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.
@@ -1,23 +0,0 @@
1
- import { ConfigurationSchema } from '@jbrowse/core/configuration'
2
-
3
- /**
4
- * #config GtfAdapter
5
- * #category adapter
6
- */
7
- function x() {} // eslint-disable-line @typescript-eslint/no-unused-vars
8
-
9
- const GtfAdapter = ConfigurationSchema(
10
- 'GtfAdapter',
11
- {
12
- /**
13
- * #slot
14
- */
15
- gtfLocation: {
16
- type: 'fileLocation',
17
- defaultValue: { uri: '/path/to/my.gtf', locationType: 'UriLocation' },
18
- },
19
- },
20
- { explicitlyTyped: true },
21
- )
22
-
23
- export default GtfAdapter
@@ -1 +0,0 @@
1
- export { default as configSchema } from './configSchema'
package/src/declare.d.ts DELETED
@@ -1 +0,0 @@
1
- declare module '@gmod/gtf'
package/src/index.ts DELETED
@@ -1,48 +0,0 @@
1
- import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType'
2
- import PluginManager from '@jbrowse/core/PluginManager'
3
- import Plugin from '@jbrowse/core/Plugin'
4
- import { configSchema as gtfAdapterConfigSchema } from './GtfAdapter'
5
- import { FileLocation } from '@jbrowse/core/util/types'
6
- import { AdapterGuesser, getFileName } from '@jbrowse/core/util/tracks'
7
-
8
- export default class GtfPlugin extends Plugin {
9
- name = 'GTFPlugin'
10
-
11
- install(pluginManager: PluginManager) {
12
- pluginManager.addAdapterType(
13
- () =>
14
- new AdapterType({
15
- name: 'GtfAdapter',
16
- displayName: 'GTF adapter',
17
- configSchema: gtfAdapterConfigSchema,
18
- getAdapterClass: () =>
19
- import('./GtfAdapter/GtfAdapter').then(r => r.default),
20
- }),
21
- )
22
- pluginManager.addToExtensionPoint(
23
- 'Core-guessAdapterForLocation',
24
- (adapterGuesser: AdapterGuesser) => {
25
- return (
26
- file: FileLocation,
27
- index?: FileLocation,
28
- adapterHint?: string,
29
- ) => {
30
- const regexGuess = /\.gtf(\.gz)?$/i
31
- const adapterName = 'GtfAdapter'
32
- const fileName = getFileName(file)
33
-
34
- const obj = {
35
- type: adapterName,
36
- gtfLocation: file,
37
- }
38
- if (regexGuess.test(fileName) && !adapterHint) {
39
- return obj
40
- } else if (adapterHint === adapterName) {
41
- return obj
42
- }
43
- return adapterGuesser(file, index, adapterHint)
44
- }
45
- },
46
- )
47
- }
48
- }
@@ -1,26 +0,0 @@
1
- GeneScaffold_1 ensembl transcript 107689 107987 . + . gene_id "ENSVPAG00000000407"; gene_version "1"; transcript_id "ENSVPAT00000000407"; transcript_version "1"; gene_source "ensembl"; gene_biotype "pseudogene"; transcript_source "ensembl"; transcript_biotype "pseudogene";
2
- GeneScaffold_1 ensembl exon 107689 107715 . + . gene_id "ENSVPAG00000000407"; gene_version "1"; transcript_id "ENSVPAT00000000407"; transcript_version "1"; exon_number "1"; gene_source "ensembl"; gene_biotype "pseudogene"; transcript_source "ensembl"; transcript_biotype "pseudogene"; exon_id "ENSVPAE00000004844"; exon_version "1";
3
- GeneScaffold_1 ensembl exon 107717 107812 . + . gene_id "ENSVPAG00000000407"; gene_version "1"; transcript_id "ENSVPAT00000000407"; transcript_version "1"; exon_number "2"; gene_source "ensembl"; gene_biotype "pseudogene"; transcript_source "ensembl"; transcript_biotype "pseudogene"; exon_id "ENSVPAE00000004847"; exon_version "1";
4
- GeneScaffold_1 ensembl exon 107824 107877 . + . gene_id "ENSVPAG00000000407"; gene_version "1"; transcript_id "ENSVPAT00000000407"; transcript_version "1"; exon_number "3"; gene_source "ensembl"; gene_biotype "pseudogene"; transcript_source "ensembl"; transcript_biotype "pseudogene"; exon_id "ENSVPAE00000004849"; exon_version "1";
5
- GeneScaffold_1 ensembl exon 107881 107895 . + . gene_id "ENSVPAG00000000407"; gene_version "1"; transcript_id "ENSVPAT00000000407"; transcript_version "1"; exon_number "4"; gene_source "ensembl"; gene_biotype "pseudogene"; transcript_source "ensembl"; transcript_biotype "pseudogene"; exon_id "ENSVPAE00000156282"; exon_version "1";
6
- GeneScaffold_1 ensembl exon 107900 107917 . + . gene_id "ENSVPAG00000000407"; gene_version "1"; transcript_id "ENSVPAT00000000407"; transcript_version "1"; exon_number "5"; gene_source "ensembl"; gene_biotype "pseudogene"; transcript_source "ensembl"; transcript_biotype "pseudogene"; exon_id "ENSVPAE00000188321"; exon_version "1";
7
- GeneScaffold_1 ensembl exon 107919 107987 . + . gene_id "ENSVPAG00000000407"; gene_version "1"; transcript_id "ENSVPAT00000000407"; transcript_version "1"; exon_number "6"; gene_source "ensembl"; gene_biotype "pseudogene"; transcript_source "ensembl"; transcript_biotype "pseudogene"; exon_id "ENSVPAE00000004854"; exon_version "1";
8
- GeneScaffold_10 ensembl transcript 37196 42373 . - . gene_id "ENSVPAG00000009976"; gene_version "1"; transcript_id "ENSVPAT00000009977"; transcript_version "1"; gene_name "RNPS1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_name "RNPS1-201"; transcript_source "ensembl"; transcript_biotype "protein_coding";
9
- GeneScaffold_10 ensembl exon 42303 42373 . - . gene_id "ENSVPAG00000009976"; gene_version "1"; transcript_id "ENSVPAT00000009977"; transcript_version "1"; exon_number "1"; gene_name "RNPS1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_name "RNPS1-201"; transcript_source "ensembl"; transcript_biotype "protein_coding"; exon_id "ENSVPAE00000120008"; exon_version "1";
10
- GeneScaffold_10 ensembl CDS 42303 42373 . - 0 gene_id "ENSVPAG00000009976"; gene_version "1"; transcript_id "ENSVPAT00000009977"; transcript_version "1"; exon_number "1"; gene_name "RNPS1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_name "RNPS1-201"; transcript_source "ensembl"; transcript_biotype "protein_coding"; protein_id "ENSVPAP00000009285"; protein_version "1";
11
- GeneScaffold_10 ensembl start_codon 42371 42373 . - 0 gene_id "ENSVPAG00000009976"; gene_version "1"; transcript_id "ENSVPAT00000009977"; transcript_version "1"; exon_number "1"; gene_name "RNPS1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_name "RNPS1-201"; transcript_source "ensembl"; transcript_biotype "protein_coding";
12
- GeneScaffold_10 ensembl exon 41909 42064 . - . gene_id "ENSVPAG00000009976"; gene_version "1"; transcript_id "ENSVPAT00000009977"; transcript_version "1"; exon_number "2"; gene_name "RNPS1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_name "RNPS1-201"; transcript_source "ensembl"; transcript_biotype "protein_coding"; exon_id "ENSVPAE00000120009"; exon_version "1";
13
- GeneScaffold_10 ensembl CDS 41909 42064 . - 1 gene_id "ENSVPAG00000009976"; gene_version "1"; transcript_id "ENSVPAT00000009977"; transcript_version "1"; exon_number "2"; gene_name "RNPS1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_name "RNPS1-201"; transcript_source "ensembl"; transcript_biotype "protein_coding"; protein_id "ENSVPAP00000009285"; protein_version "1";
14
- GeneScaffold_10 ensembl exon 41149 41278 . - . gene_id "ENSVPAG00000009976"; gene_version "1"; transcript_id "ENSVPAT00000009977"; transcript_version "1"; exon_number "3"; gene_name "RNPS1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_name "RNPS1-201"; transcript_source "ensembl"; transcript_biotype "protein_coding"; exon_id "ENSVPAE00000120011"; exon_version "1";
15
- GeneScaffold_10 ensembl CDS 41149 41278 . - 1 gene_id "ENSVPAG00000009976"; gene_version "1"; transcript_id "ENSVPAT00000009977"; transcript_version "1"; exon_number "3"; gene_name "RNPS1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_name "RNPS1-201"; transcript_source "ensembl"; transcript_biotype "protein_coding"; protein_id "ENSVPAP00000009285"; protein_version "1";
16
- GeneScaffold_10 ensembl exon 41086 41147 . - . gene_id "ENSVPAG00000009976"; gene_version "1"; transcript_id "ENSVPAT00000009977"; transcript_version "1"; exon_number "4"; gene_name "RNPS1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_name "RNPS1-201"; transcript_source "ensembl"; transcript_biotype "protein_coding"; exon_id "ENSVPAE00000120015"; exon_version "1";
17
- GeneScaffold_10 ensembl CDS 41086 41147 . - 0 gene_id "ENSVPAG00000009976"; gene_version "1"; transcript_id "ENSVPAT00000009977"; transcript_version "1"; exon_number "4"; gene_name "RNPS1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_name "RNPS1-201"; transcript_source "ensembl"; transcript_biotype "protein_coding"; protein_id "ENSVPAP00000009285"; protein_version "1";
18
- GeneScaffold_10 ensembl exon 40676 40778 . - . gene_id "ENSVPAG00000009976"; gene_version "1"; transcript_id "ENSVPAT00000009977"; transcript_version "1"; exon_number "5"; gene_name "RNPS1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_name "RNPS1-201"; transcript_source "ensembl"; transcript_biotype "protein_coding"; exon_id "ENSVPAE00000120018"; exon_version "1";
19
- GeneScaffold_10 ensembl CDS 40676 40778 . - 1 gene_id "ENSVPAG00000009976"; gene_version "1"; transcript_id "ENSVPAT00000009977"; transcript_version "1"; exon_number "5"; gene_name "RNPS1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_name "RNPS1-201"; transcript_source "ensembl"; transcript_biotype "protein_coding"; protein_id "ENSVPAP00000009285"; protein_version "1";
20
- GeneScaffold_10 ensembl exon 40215 40368 . - . gene_id "ENSVPAG00000009976"; gene_version "1"; transcript_id "ENSVPAT00000009977"; transcript_version "1"; exon_number "6"; gene_name "RNPS1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_name "RNPS1-201"; transcript_source "ensembl"; transcript_biotype "protein_coding"; exon_id "ENSVPAE00000120019"; exon_version "1";
21
- GeneScaffold_10 ensembl CDS 40215 40368 . - 0 gene_id "ENSVPAG00000009976"; gene_version "1"; transcript_id "ENSVPAT00000009977"; transcript_version "1"; exon_number "6"; gene_name "RNPS1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_name "RNPS1-201"; transcript_source "ensembl"; transcript_biotype "protein_coding"; protein_id "ENSVPAP00000009285"; protein_version "1";
22
- GeneScaffold_10 ensembl exon 37995 38136 . - . gene_id "ENSVPAG00000009976"; gene_version "1"; transcript_id "ENSVPAT00000009977"; transcript_version "1"; exon_number "7"; gene_name "RNPS1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_name "RNPS1-201"; transcript_source "ensembl"; transcript_biotype "protein_coding"; exon_id "ENSVPAE00000120020"; exon_version "1";
23
- GeneScaffold_10 ensembl CDS 37995 38136 . - 2 gene_id "ENSVPAG00000009976"; gene_version "1"; transcript_id "ENSVPAT00000009977"; transcript_version "1"; exon_number "7"; gene_name "RNPS1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_name "RNPS1-201"; transcript_source "ensembl"; transcript_biotype "protein_coding"; protein_id "ENSVPAP00000009285"; protein_version "1";
24
- GeneScaffold_10 ensembl exon 37196 37295 . - . gene_id "ENSVPAG00000009976"; gene_version "1"; transcript_id "ENSVPAT00000009977"; transcript_version "1"; exon_number "8"; gene_name "RNPS1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_name "RNPS1-201"; transcript_source "ensembl"; transcript_biotype "protein_coding"; exon_id "ENSVPAE00000120021"; exon_version "1";
25
- GeneScaffold_10 ensembl CDS 37199 37295 . - 1 gene_id "ENSVPAG00000009976"; gene_version "1"; transcript_id "ENSVPAT00000009977"; transcript_version "1"; exon_number "8"; gene_name "RNPS1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_name "RNPS1-201"; transcript_source "ensembl"; transcript_biotype "protein_coding"; protein_id "ENSVPAP00000009285"; protein_version "1";
26
- GeneScaffold_10 ensembl stop_codon 37196 37198 . - 0 gene_id "ENSVPAG00000009976"; gene_version "1"; transcript_id "ENSVPAT00000009977"; transcript_version "1"; exon_number "8"; gene_name "RNPS1"; gene_source "ensembl"; gene_biotype "protein_coding"; transcript_name "RNPS1-201"; transcript_source "ensembl"; transcript_biotype "protein_coding";
@@ -1,40 +0,0 @@
1
- ctgA example exon 1050 1500 . + . transcript_id "EDEN.1"; gene_id "EDEN"; gene_name "EDEN";
2
- ctgA example exon 1050 1500 . + . transcript_id "EDEN.2"; gene_id "EDEN"; gene_name "EDEN";
3
- ctgA example five_prime_UTR 1050 1200 . + 0 transcript_id "EDEN.1"; gene_id "EDEN"; gene_name "EDEN";
4
- ctgA example five_prime_UTR 1050 1200 . + 0 transcript_id "EDEN.2"; gene_id "EDEN"; gene_name "EDEN";
5
- ctgA example CDS 1201 1500 . + 0 transcript_id "EDEN.1"; gene_id "EDEN"; gene_name "EDEN";
6
- ctgA example CDS 1201 1500 . + 0 transcript_id "EDEN.2"; gene_id "EDEN"; gene_name "EDEN";
7
- ctgA example exon 1300 1500 . + . transcript_id "EDEN.3"; gene_id "EDEN"; gene_name "EDEN";
8
- ctgA example five_prime_UTR 1300 1500 . + 1 transcript_id "EDEN.3"; gene_id "EDEN"; gene_name "EDEN";
9
- ctgA example CDS 3000 3902 . + 0 transcript_id "EDEN.1"; gene_id "EDEN"; gene_name "EDEN";
10
- ctgA example exon 3000 3902 . + . transcript_id "EDEN.1"; gene_id "EDEN"; gene_name "EDEN";
11
- ctgA example exon 3000 3902 . + . transcript_id "EDEN.3"; gene_id "EDEN"; gene_name "EDEN";
12
- ctgA example five_prime_UTR 3000 3300 . + 1 transcript_id "EDEN.3"; gene_id "EDEN"; gene_name "EDEN";
13
- ctgA example CDS 3301 3902 . + 0 transcript_id "EDEN.3"; gene_id "EDEN"; gene_name "EDEN";
14
- ctgA example CDS 5000 5500 . + 0 transcript_id "EDEN.1"; gene_id "EDEN"; gene_name "EDEN";
15
- ctgA example CDS 5000 5500 . + 0 transcript_id "EDEN.2"; gene_id "EDEN"; gene_name "EDEN";
16
- ctgA example CDS 5000 5500 . + 1 transcript_id "EDEN.3"; gene_id "EDEN"; gene_name "EDEN";
17
- ctgA example exon 5000 5500 . + . transcript_id "EDEN.1"; gene_id "EDEN"; gene_name "EDEN";
18
- ctgA example exon 5000 5500 . + . transcript_id "EDEN.2"; gene_id "EDEN"; gene_name "EDEN";
19
- ctgA example exon 5000 5500 . + . transcript_id "EDEN.3"; gene_id "EDEN"; gene_name "EDEN";
20
- ctgA example CDS 7000 7600 . + 1 transcript_id "EDEN.3"; gene_id "EDEN"; gene_name "EDEN";
21
- ctgA example CDS 7000 7608 . + 0 transcript_id "EDEN.1"; gene_id "EDEN"; gene_name "EDEN";
22
- ctgA example CDS 7000 7608 . + 0 transcript_id "EDEN.2"; gene_id "EDEN"; gene_name "EDEN";
23
- ctgA example exon 7000 9000 . + . transcript_id "EDEN.1"; gene_id "EDEN"; gene_name "EDEN";
24
- ctgA example exon 7000 9000 . + . transcript_id "EDEN.2"; gene_id "EDEN"; gene_name "EDEN";
25
- ctgA example exon 7000 9000 . + . transcript_id "EDEN.3"; gene_id "EDEN"; gene_name "EDEN";
26
- ctgA example three_prime_UTR 7601 9000 . + 1 transcript_id "EDEN.3"; gene_id "EDEN"; gene_name "EDEN";
27
- ctgA example three_prime_UTR 7609 9000 . + 0 transcript_id "EDEN.1"; gene_id "EDEN"; gene_name "EDEN";
28
- ctgA example three_prime_UTR 7609 9000 . + 0 transcript_id "EDEN.2"; gene_id "EDEN"; gene_name "EDEN";
29
- ctgA bare_predicted CDS 10000 11500 . + 0 transcript_id "Apple1";
30
- ctgA predicted CDS 13500 13800 . + 0 transcript_id "cds-Apple2";
31
- ctgA predicted CDS 15000 15500 . + 1 transcript_id "cds-Apple2";
32
- ctgA predicted CDS 16500 17000 . + 2 transcript_id "cds-Apple2";
33
- ctgA exonerate UTR 17400 17999 . + 0 transcript_id "rna-Apple3";
34
- ctgA exonerate exon 17400 18800 . + . transcript_id "rna-Apple3";
35
- ctgA exonerate CDS 18000 18800 . + 0 transcript_id "rna-Apple3";
36
- ctgA exonerate CDS 19000 19500 . + 0 transcript_id "rna-Apple3";
37
- ctgA exonerate exon 19000 19500 . + . transcript_id "rna-Apple3";
38
- ctgA exonerate CDS 21000 21200 . + 0 transcript_id "rna-Apple3";
39
- ctgA exonerate exon 21000 23000 . + . transcript_id "rna-Apple3";
40
- ctgA exonerate UTR 21201 23000 . + 0 transcript_id "rna-Apple3";
package/src/util.ts DELETED
@@ -1,77 +0,0 @@
1
- export type Strand = '+' | '-' | '.' | '?'
2
- export interface FeatureLoc {
3
- [key: string]: unknown
4
- start: number
5
- end: number
6
- strand: Strand
7
- seq_name: string
8
- child_features: FeatureLoc[][]
9
- data: unknown
10
- derived_features: unknown
11
- attributes: { [key: string]: unknown[] }
12
- }
13
-
14
- export function featureData(data: FeatureLoc) {
15
- const f: Record<string, unknown> = { ...data }
16
- ;(f.start as number) -= 1 // convert to interbase
17
- f.strand = { '+': 1, '-': -1, '.': 0, '?': undefined }[data.strand] // convert strand
18
- f.phase = Number(data.frame)
19
- f.refName = data.seq_name
20
- if (data.score === null) {
21
- delete f.score
22
- }
23
- if (data.frame === null) {
24
- delete f.score
25
- }
26
- const defaultFields = new Set([
27
- 'start',
28
- 'end',
29
- 'seq_name',
30
- 'score',
31
- 'featureType',
32
- 'source',
33
- 'frame',
34
- 'strand',
35
- ])
36
- for (const a of Object.keys(data.attributes)) {
37
- let b = a.toLowerCase()
38
- if (defaultFields.has(b)) {
39
- // add "suffix" to tag name if it already exists
40
- // reproduces behavior of NCList
41
- b += '2'
42
- }
43
- if (data.attributes[a] !== null) {
44
- let attr = data.attributes[a] as string[] | string
45
- if (Array.isArray(attr) && attr.length === 1) {
46
- // gtf uses double quotes for text values in the attributes column,
47
- // remove them
48
- attr = `${attr[0]}`.replaceAll(/^"|"$/g, '')
49
- }
50
- f[b] = attr
51
- }
52
- }
53
- f.refName = f.seq_name
54
- f.type = f.featureType
55
-
56
- // the SimpleFeature constructor takes care of recursively inflating subfeatures
57
- if (data.child_features && data.child_features.length > 0) {
58
- f.subfeatures = data.child_features.flatMap(childLocs =>
59
- childLocs.map(childLoc => featureData(childLoc)),
60
- )
61
- }
62
-
63
- delete f.child_features
64
- delete f.data
65
- delete f.derived_features
66
- // eslint-disable-next-line no-underscore-dangle
67
- delete f._linehash
68
- delete f.attributes
69
- delete f.seq_name
70
- delete f.featureType
71
- delete f.frame
72
-
73
- if (f.transcript_id) {
74
- f.name = f.transcript_id
75
- }
76
- return f
77
- }