Skip to content

Commit

Permalink
Adds ability for CLI to recognize plaintext BED files (#3173)
Browse files Browse the repository at this point in the history
* Add plaintext bed recognition to cli

* Remove inaccurate comments
  • Loading branch information
cmdcolin authored Sep 7, 2022
1 parent 1b125fe commit 8685962
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
7 changes: 7 additions & 0 deletions products/jbrowse-cli/src/commands/add-track.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,13 @@ export default class AddTrack extends JBrowseCommand {
}
}

if (/\.bed$/i.test(fileName)) {
return {
type: 'BedAdapter',
bedLocation: makeLocation(fileName),
}
}

if (/\.(bb|bigbed)$/i.test(fileName)) {
return {
type: 'BigBedAdapter',
Expand Down
14 changes: 1 addition & 13 deletions products/jbrowse-cli/src/types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import { Track, LocalPathLocation, UriLocation } from '../base'
import path from 'path'
import fetch from '../fetchWithProxy'

// Method for handing off the parsing of a gff3 file URL.
// Calls the proper parser depending on if it is gzipped or not.
// Returns a @gmod/gff stream.
export async function createRemoteStream(urlIn: string) {
const response = await fetch(urlIn)
if (!response.ok) {
Expand All @@ -16,8 +13,6 @@ export async function createRemoteStream(urlIn: string) {
return response
}

// Checks if the passed in string is a valid URL.
// Returns a boolean.
export function isURL(FileName: string) {
let url

Expand Down Expand Up @@ -110,14 +105,7 @@ export function supported(type: string) {
'VcfAdapter',
].includes(type)
}
/**
* Generates metadata of index given a filename (trackId or assembly)
* @param name - assembly name or trackId
* @param attributes - attributes indexed
* @param include - feature types included from index
* @param exclude - feature types excluded from index
* @param configs - list of track
*/

export async function generateMeta({
configs,
attributes,
Expand Down

0 comments on commit 8685962

Please sign in to comment.