Skip to content

Commit

Permalink
Merge pull request #21 from esteinig/test_ci
Browse files Browse the repository at this point in the history
test ci/cd
  • Loading branch information
esteinig committed Feb 18, 2023
2 parents ab97670 + 726992a commit 3327d01
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/align.rs
Original file line number Diff line number Diff line change
Expand Up @@ -822,12 +822,14 @@ impl ReadAlignment {
Ok(())
}

#[allow(clippy::too_many_arguments)]
pub fn group_output(
&self,
coverage_fields: &[CoverageFields],
grouped_regions: u64,
grouped_coverage: f64,
grouped_alignments: u64,
grouped_reads: u64,
group_by: String,
group_sep: String,
) -> Result<Vec<CoverageFields>, ReadAlignmentError> {
Expand Down Expand Up @@ -915,6 +917,7 @@ impl ReadAlignment {
if grouped_fields.regions >= grouped_regions
&& grouped_fields.coverage >= grouped_coverage
&& grouped_fields.alignments >= grouped_alignments
&& grouped_fields.reads >= grouped_reads
{
grouped_coverage_fields.push(grouped_fields);
}
Expand Down
13 changes: 9 additions & 4 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ use structopt::StructOpt;
pub struct Cli {
/// Alignment file (SAM/BAM/CRAM/PAF)
#[structopt(
short, long, parse(try_from_os_str = check_file_exists), required = true
short = "i", long, parse(try_from_os_str = check_file_exists), required = true
)]
pub alignment: PathBuf,
/// bam: SAM/BAM/CRAM alignment; paf: PAF alignment
///
/// Default is to attempt to infer the input alignment format automatically from the filename
/// extension (bam|sam|cram|paf). This option is used to override that.
#[structopt(
short = "i",
long,
value_name = "bam|paf",
possible_values = &["bam", "paf"],
Expand Down Expand Up @@ -92,15 +91,15 @@ pub struct Cli {
/// - unique reads are recomputed across members of the group
/// - covered base pairs in the reference sequence lengths are set to 0
/// - coverage is selected to be the highest by a member of the group.
#[structopt(short, long)]
#[structopt(short = "g", long)]
pub group_by: Option<String>,
/// Group field separator in the reference sequence description
///
/// Often there are multiple fields in the header of the reference
/// sequences (e.g. taxid=1101 | taxname=argh). A delimitor needs to
/// be specified to signal the end of a specific grouping field
/// (e.g. --group-sep "|" with --group-by "taxid=").
#[structopt(long, default_value = ";")]
#[structopt(short = "s", long, default_value = ";")]
pub group_sep: String,
/// A file with a string per line to exclude alignments
/// if the string occurs in the target sequence description
Expand Down Expand Up @@ -193,6 +192,12 @@ pub struct Cli {
/// across reference sequences if results are grouped
#[structopt(long, default_value = "0")]
pub group_aligned: u64,
/// Minimum grouped coverage reads
///
/// Filters results by a minimum number of unique reads
/// across reference sequences if results are grouped
#[structopt(long, default_value = "0")]
pub group_reads: u64,
/// Output read identifiers of all alignments to file
///
/// Creates a file (.txt) that contains the identifiers
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ fn main() -> Result<(), ReadAlignmentError> {
args.group_regions,
args.group_coverage,
args.group_aligned,
args.group_reads,
group_field,
args.group_sep.clone(),
)?;
Expand Down

0 comments on commit 3327d01

Please sign in to comment.