Skip to content

Commit

Permalink
fix count accessions by taxid test
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenixAja committed Apr 8, 2024
1 parent 890e28d commit 2e1c117
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion workflows/index-generation/index-generation.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ task CompressDatabase {
--input-taxid-dir $READS_BY_TAXID_PATH \
--output-taxid-dir $SORTED_TAXID_DIR_NAME

mkdir $SPLIT_APART_TAXID_DIR_NAME
mkdir $SPLIT_APART_TAXID_DIR_NAME # this is needed to split up large taxids into smaller chunks to reduce memory usage

ncbi-compress fasta-compress-from-taxid-dir ~{if database_type == "nr" then "--is-protein-fasta" else ""} \
--input-fasta-dir $SORTED_TAXID_DIR_NAME \
Expand Down
3 changes: 3 additions & 0 deletions workflows/index-generation/ncbi-compress/src/fasta_tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ pub mod fasta_tools {
.open(&output_tsv_path)?;

writer.write_all(format!("{}\t{}\n", taxid, records.count()).as_bytes())?;
writer.flush()?;
}
Ok(())
}
Expand Down Expand Up @@ -288,6 +289,7 @@ mod tests {
let mut truth_rdr = ReaderBuilder::new()
.delimiter(b'\t')
.trim(Trim::All)
.has_headers(false)
.from_path(output_truth_tsv_file)
.unwrap();
let mut truth_records = Vec::new();
Expand All @@ -305,6 +307,7 @@ mod tests {
let mut test_rdr = ReaderBuilder::new()
.delimiter(b'\t')
.trim(Trim::All)
.has_headers(false)
.from_path(test_truth_tsv_file_path_str)
.unwrap();
let mut test_records = Vec::new();
Expand Down

0 comments on commit 2e1c117

Please sign in to comment.