FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: Check for both .csi and .tbi VCF index files by fxwiegand · Pull Request #395 · alignoth/alignoth · GitHub

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rs  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
12 changes: 7 additions & 5 deletions src/main.rs
This file contains hidden or 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
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,16 @@ async fn main() -> Result<()> {
)?;
let mut highlight = opt.highlight.as_ref().cloned().unwrap_or_default();
if let Some(vcf_path) = opt.vcf.as_ref() {
let index = PathBuf::from(&format!("{}.csi", vcf_path.display()));
if index.exists() {
let csi_index = PathBuf::from(&format!("{}.csi", vcf_path.display()));
let tbi_index = PathBuf::from(&format!("{}.tbi", vcf_path.display()));
if csi_index.exists() || tbi_index.exists() {
highlight.extend(VcfHighlight::new(vcf_path.clone()).intervals(region)?);
} else {
bail!(
"VCF/BCF index not found: {}. Please create an index using `bcftools index {}`",
index.display(),
vcf_path.display()
"VCF/BCF index not found: {csi} or {tbi}. Please create an index using `bcftools index {vcf}` or `tabix {vcf}`.",
csi = csi_index.display(),
tbi = tbi_index.display(),
vcf = vcf_path.display()
);
}
}
Expand Down
Loading

Back | FazBrowse Home | New Git URL