Skip to content

Commit

Permalink
Simplify distribution: no error class export
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Dec 19, 2024
1 parent 08098e1 commit 2b3f8ec
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 54 deletions.
104 changes: 53 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ directory for usage with script tag
##### Table of Contents

- [CramRecord](#cramrecord)
- [Parameters](#parameters)
- [isPaired](#ispaired)
- [isProperlyPaired](#isproperlypaired)
- [isSegmentUnmapped](#issegmentunmapped)
Expand All @@ -161,12 +162,34 @@ directory for usage with script tag
- [getReadBases](#getreadbases)
- [getPairOrientation](#getpairorientation)
- [addReferenceSequence](#addreferencesequence)
- [Parameters](#parameters)
- [Parameters](#parameters-1)

#### CramRecord

Class of each CRAM record returned by this API.

##### Parameters

- `$0` **any** 

- `$0.flags`  
- `$0.cramFlags`  
- `$0.readLength`  
- `$0.mappingQuality`  
- `$0.lengthOnRef`  
- `$0.qualityScores`  
- `$0.mateRecordNumber`  
- `$0.readBases`  
- `$0.readFeatures`  
- `$0.mateToUse`  
- `$0.readGroupId`  
- `$0.readName`  
- `$0.sequenceId`  
- `$0.uniqueId`  
- `$0.templateSize`  
- `$0.alignmentStart`  
- `$0.tags`  

##### isPaired

Returns
Expand Down Expand Up @@ -282,23 +305,23 @@ of paired orientatin
##### addReferenceSequence

Annotates this feature with the given reference sequence basepair information.
This will add a `sub` and a `ref` item to base subsitution read features given
This will add a `sub` and a `ref` item to base substitution read features given
the actual substituted and reference base pairs, and will make the
`getReadSequence()` method work.

###### Parameters

- `refRegion`
**[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
**[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 

- `refRegion.start`
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 
- `refRegion.end`
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 
- `refRegion.seq`
**[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
**[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 

- `compressionScheme` **CramContainerCompressionScheme**
- `compressionScheme` **CramContainerCompressionScheme** 

Returns
**[undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)**
Expand Down Expand Up @@ -336,9 +359,9 @@ that show insertions, deletions, substitutions, etc.
##### Parameters

- `args`
**[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
**[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 

- `args.cram` **CramFile**
- `args.cram` **CramFile** 
- `args.index` **Index-like** object that supports
getEntriesForRange(seqId,start,end) -> Promise\[Array\[index entries]]
- `args.cacheSize`
Expand All @@ -363,14 +386,20 @@ that show insertions, deletions, substitutions, etc.
- `end`
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
end of the range of interest. 1-based closed coordinates.
- `opts` (optional, default `{}`)
- `opts` **{viewAsPairs:
[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?,
pairAcrossChr:
[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?,
maxInsertSize:
[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?}**
(optional, default `{}`)

#### hasDataForReferenceSequence

##### Parameters

- `seqId`
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 

Returns
**[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)**
Expand All @@ -383,42 +412,15 @@ ID

##### Table of Contents

- [constructor](#constructor)
- [Parameters](#parameters)
- [containerCount](#containercount)

#### constructor

##### Parameters

- `args`
**[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**

- `args.filehandle`
**[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?**
a filehandle that implements the stat() and read() methods of the Node
filehandle API <https://nodejs.org/api/fs.html#fs_class_filehandle>
- `args.path`
**[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?**
path to the cram file
- `args.url`
**[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?**
url for the cram file. also supports file:// urls for local files
- `args.seqFetch`
**[function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?**
a function with signature `(seqId, startCoordinate, endCoordinate)` that
returns a promise for a string of sequence bases
- `args.cacheSize`
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?**
optional maximum number of CRAM records to cache. default 20,000
- `args.checkSequenceMD5`
**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?**
default true. if false, disables verifying the MD5 checksum of the reference
sequence underlying a slice. In some applications, this check can cause an
inconvenient amount (many megabases) of sequences to be fetched.

#### containerCount

Returns
**[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<([number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
[undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))>**&#x20;

### CraiIndex

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
Expand All @@ -437,20 +439,20 @@ ID
##### Parameters

- `args`
**[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
**[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;

- `args.path`
**[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?**
**[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?**&#x20;
- `args.url`
**[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?**
- `args.filehandle` **FileHandle?**
**[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?**&#x20;
- `args.filehandle` **FileHandle?**&#x20;

#### hasDataForReferenceSequence

##### Parameters

- `seqId`
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**&#x20;

Returns
**[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)**
Expand All @@ -464,11 +466,11 @@ fetch index entries for the given range
##### Parameters

- `seqId`
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**&#x20;
- `queryStart`
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**&#x20;
- `queryEnd`
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**&#x20;

Returns
**[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)**
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"node": ">=6"
},
"files": [
"errors.js",
"src",
"dist",
"esm"
Expand All @@ -24,14 +23,14 @@
"test": "vitest",
"lint": "eslint --report-unused-disable-directives --max-warnings 0",
"format": "prettier --write .",
"docs": "documentation readme --shallow src/indexedCramFile.ts --section=IndexedCramFile; documentation readme --shallow src/cramFile/file.ts --section=CramFile; documentation readme --shallow src/craiIndex.ts --section=CraiIndex; documentation readme --shallow errors.ts '--section=Exception Classes'; documentation readme --shallow src/cramFile/file.ts --section=CramFile; documentation readme --shallow src/cramFile/record.ts --section=CramRecord",
"docs": "documentation readme --shallow src/indexedCramFile.ts --section=IndexedCramFile; documentation readme --shallow src/cramFile/file.ts --section=CramFile; documentation readme --shallow src/craiIndex.ts --section=CraiIndex; documentation readme --shallow src/cramFile/file.ts --section=CramFile; documentation readme --shallow src/cramFile/record.ts --section=CramRecord",
"prebuild": "yarn clean",
"clean": "rimraf dist esm",
"build:esm": "tsc --outDir esm",
"build:es5": "tsc --module commonjs --outDir dist",
"build": "yarn build:esm && yarn build:es5",
"postbuild": "webpack",
"preversion": "yarn test --run && yarn build && cp dist/errors.js errors.js",
"preversion": "yarn test --run && yarn build",
"postpublish": "rm errors.js",
"postversion": "git push --follow-tags"
},
Expand Down

0 comments on commit 2b3f8ec

Please sign in to comment.