Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability for CLI to recognize plaintext BED files #3173

Merged
merged 2 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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