pub fn from_paths<P: AsRef<Path>>(filepaths: &[P]) -> Result<Self, Report> {
    if filepaths.is_empty() {
      info!("Reading input fasta from standard input");

      #[cfg(not(target_arch = "wasm32"))]
      if is_tty(Stream::Stdin) {
        warn!("{TTY_WARNING}");
      }

      return Ok(Self::new(Box::new(BufReader::new(stdin()))));
    }

    let readers: Vec<Box<dyn BufRead + 'a>> = filepaths
      .iter()
      .map(|filepath| -> Result<Box<dyn BufRead + 'a>, Report> {
        let filepath = filepath.as_ref();
        let file = File::open(&filepath).wrap_err_with(|| format!("When opening file: {filepath:?}"))?;
        let decompressor = Decompressor::from_path(file, &filepath)?;
        let reader = BufReader::with_capacity(32 * 1024, decompressor);
        Ok(Box::new(reader))
      })
      .collect::<Result<Vec<Box<dyn BufRead + 'a>>, Report>>()?;

    let concat = concat(readers.into_iter());
    let concat_buf = BufReader::new(concat);

    Ok(Self::new(Box::new(concat_buf)))
  }
/// Reads multiple files sequentially given a set of paths
Reads multiple files sequentially given a set of paths
Reads multiple files sequentially given a set of paths
pub fn from_paths<P: AsRef<Path>>(filepaths: &[P]) -> Result<Self, Report> {
    if filepaths.is_empty() {
      info!("Reading input fasta from standard input");
      #[cfg(not(target_arch = "wasm32"))]
      if is_tty(Stream::Stdin) {
        warn!("{TTY_WARNING}");
      }
      return Ok(Self::new(Box::new(BufReader::new(stdin()))));
    }
    let readers: Vec<Box<dyn BufRead + 'a>> = filepaths
      .iter()
      .map(|filepath| -> Result<Box<dyn BufRead + 'a>, Report> {
        let filepath = filepath.as_ref();
        let file = File::open(&filepath).wrap_err_with(|| format!("When opening file: {filepath:?}"))?;
        let decompressor = Decompressor::from_path(file, &filepath)?;
        let reader = BufReader::with_capacity(32 * 1024, decompressor);
        Ok(Box::new(reader))
      })
      .collect::<Result<Vec<Box<dyn BufRead + 'a>>, Report>>()?;
    let concat = concat(readers.into_iter());
    let concat_buf = BufReader::new(concat);
    Ok(Self::new(Box::new(concat_buf)))
  }
pub fn from_paths < P : AsRef < Path > > ( filepaths : & [ P ] ) -> Result < Self , Report > { if filepaths . is_empty ( ) { info ! ( " " ) ; # [ cfg ( not ( target_arch " " ) ) ] if is_tty ( Stream :: Stdin ) { warn ! ( " " ) ; } return Ok ( Self :: new ( Box :: new ( BufReader :: new ( stdin ( ) ) ) ) ) ; } let readers : Vec < Box < dyn BufRead + ' a > > = filepaths . iter ( ) . map ( | filepath | -> Result < Box < dyn BufRead + ' a > , Report > { let filepath = filepath . as_ref ( ) ; let file = File :: open ( & filepath ) . wrap_err_with ( | | format ! ( " " ) ) ? ; let decompressor = Decompressor :: from_path ( file , & filepath ) ? ; let reader = BufReader :: with_capacity ( 32 * 1024 , decompressor ) ; Ok ( Box :: new ( reader ) ) } ) . collect :: < Result < Vec < Box < dyn BufRead + ' a > > , Report > > ( ) ? ; let concat = concat ( readers . into_iter ( ) ) ; let concat_buf = BufReader :: new ( concat ) ; Ok ( Self :: new ( Box :: new ( concat_buf ) ) ) }
Reads multiple files sequentially given a set of paths
Reads multiple files sequentially given a set of paths
filepaths
&[P]
filepaths
&[P]