Skip to content

Commit

Permalink
[skip ci] Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Oct 31, 2023
1 parent e01bbcb commit 9831c08
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { IAnyStateTreeNode } from 'mobx-state-tree'
import { makeStyles } from 'tss-react/mui'
import { saveAs } from 'file-saver'
import { observer } from 'mobx-react'
import { Dialog, ErrorMessage, LoadingEllipses } from '@jbrowse/core/ui'
import { Dialog, ErrorMessage } from '@jbrowse/core/ui'
import {
getSession,
getContainingView,
Expand Down
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 9831c08

Please sign in to comment.