Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Sep 25, 2023
1 parent c9237a8 commit ace1459
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion plugins/variants/src/VariantTrack/saveTrackFormats/vcf.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import { Feature } from '@jbrowse/core/util'

function generateINFO(feature: Feature) {
return Object.entries(feature.get('INFO'))
.map(([key, value]) => `${key}=${value}`)
.join(';')
}
export function stringifyVCF({ features }: { features: Feature[] }) {
const fields = ['refName', 'start', 'name', 'REF', 'ALT', 'QUAL', 'FILTER']
return features
.map(feature => {
return `hello ${feature.get('name')}`
return `${fields
.map(field => feature.get(field) || '.')
.join('\t')}\t${generateINFO(feature)}`
})
.join('\n')
}

0 comments on commit ace1459

Please sign in to comment.