Created
June 10, 2019 20:14
-
-
Save lidaof/0d9a4a95decc74ce972b3883702a8426 to your computer and use it in GitHub Desktop.
Testing local bam
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import './App.css'; | |
import { BamFile } from '@gmod/bam'; | |
class App extends Component { | |
handleFileUpload = async (event) => { | |
const fileList = Array.from(event.target.files); | |
const baiFilehandle = fileList.filter(f => f.name.endsWith('.bai'))[0]; | |
const bamFilehandle = fileList.filter(f => !f.name.endsWith('.bai'))[0]; | |
const bam = new BamFile({ | |
bamFilehandle, | |
baiFilehandle, | |
}); | |
const header = await bam.getHeader(); | |
console.log(header); | |
} | |
render() { | |
return ( | |
<div className="App"> | |
<input type="file" id="trackFile" multiple onChange={this.handleFileUpload} /> | |
</div> | |
); | |
} | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment