NAME

Qiime2::Artifact - A parser for Qiime2 artifact files

VERSION

version 0.14.0

Wiki

This module is a work-in-progress and the documentation of the API can be found in the GitHub wiki: https://github.com/telatin/qiime2tools/wiki/.

Synopsis

use Qiime2::Artifact;

my $artifact = Qiime2::Artifact->new( {
      filename => 'tree.qza'
  } );

print "Artifact_ID: ",  $artifact->{id};

Methods

new()

Load artifact from file. Parameters are:

filename (path, required)

Path to the artifact file to be imported (typical extensions are qza and qzv, but they are not enforced)

unzip (path)

To specify the absolute path to unzip binary. By default system unzip will be used.

verbose (bool)

Enable verbose reporting (for developers)

get($key)

Return the $artifact-{$key}>, and throws an error if the error is not found.

extract_file($data_file, $target_path)

Extracts a specific file from the artifact's data directory to a specified path.

Parameters: - $data_file: The name of the file within the artifact's data directory - $target_path: The full path where the file should be extracted to

Returns: - 1 on success - Dies with an error message on failure

Example:

$artifact->extract_file('taxonomy.tsv', '/path/to/extracted/taxonomy.tsv');
get_bib()

Extracts and returns the bibliography information from the QIIME2 artifact. The bibliography is stored in BibTeX format within the artifact's zip file at {uuid}/provenance/citations.bib.

Returns: - The content of the bibliography file if found - undef if no bibliography is found or if extraction fails

Example:

my $bib = $artifact->get_bib();
print $bib if defined $bib;

Artifact object

AUTHOR

Andrea Telatin <andrea@telatin.com>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2020 by Andrea Telatin.

This is free software, licensed under:

The MIT (X11) License