Convert-Pheno

 view release on metacpan or  search on metacpan

lib/Convert/Pheno.pm  view on Meta::CPAN

        local $Data::Dumper::Indent    = 1;
        local $Data::Dumper::Useqq     = 1;
        local $Data::Dumper::Deparse   = 1;
        local $Data::Dumper::Quotekeys = 1;
        local $Data::Dumper::Sortkeys  = 1;
        local $Data::Dumper::Pair      = ' : ';
        print Dumper shift;
    }
}

1;

=head1 NAME

Convert::Pheno - Convert clinical and phenotypic data between supported models

=head1 SYNOPSIS

 use Convert::Pheno;

 my $pxf = {
     "phenopacket" => {
         "id"      => "P0007500",
         "subject" => {
             "id"          => "P0007500",
             "dateOfBirth" => "2000-01-01T00:00:00Z",
             "sex"         => "FEMALE"
         }
     }
 };

 my $converter = Convert::Pheno->new(
     {
         data   => $pxf,
         method => 'pxf2bff'
     }
 );

 my $individual = $converter->pxf2bff;

=head1 DESCRIPTION

C<Convert::Pheno> is the conversion engine used by the C<convert-pheno>
command-line program. It converts supported in-memory data structures and
route-specific file inputs between Beacon v2 Models Format (BFF),
Phenopackets v2 (PXF), OMOP-CDM, REDCap, cBioPortal clinical study packages,
CDISC-ODM, CDISC Dataset-JSON, CDISC Dataset-XML, FHIR R4, openEHR, and tabular
representations.

Conversion availability and required arguments depend on the selected route.
Mapping-file conversions use the Mapping V2 contract and require
C<mappingVersion: 2>; pre-V2 mapping files are rejected.

=head1 METHODS

=head2 new

 my $converter = Convert::Pheno->new(\%arguments);

Creates a converter. C<method> identifies the public conversion method.
In-memory routes receive decoded input under C<data>; file-based routes use
the arguments documented for that conversion.

=head2 Conversion methods

 my $result = $converter->$method;

In-memory conversions return Perl data structures. Streaming and file-output
routes write to their configured destinations and may instead return a
completion status. See the module guide for supported methods, arguments,
multi-entity results, and Python interoperability.

=head1 DOCUMENTATION

=over

=item Project documentation

L<https://cnag-biomedical-informatics.github.io/convert-pheno>

=item Module usage

L<https://cnag-biomedical-informatics.github.io/convert-pheno/use-as-a-module>

=item Command-line interface

L<https://cnag-biomedical-informatics.github.io/convert-pheno/use-as-a-command-line-interface>

=back

=head1 ERRORS

Invalid input, unsupported routes, and conversion failures raise exceptions.
Callers that need recovery should invoke conversion methods inside C<eval> or
another exception-handling mechanism.

=head1 CITATION

Please cite the following reference in published work that uses
C<Convert-Pheno>:

Rueda, M et al., (2024). Convert-Pheno: A software toolkit for the interconversion of standard data models for phenotypic data. Journal of Biomedical Informatics. L<DOI|https://doi.org/10.1016/j.jbi.2023.104558>

=head1 AUTHOR

Written by Manuel Rueda, PhD. Info about CNAG can be found at L<https://www.cnag.eu>.

=head1 COPYRIGHT AND LICENSE

Copyright 2022-2026 Manuel Rueda and CNAG.

This software is distributed under the Artistic License 2.0. See the LICENSE
file included in this distribution.

=cut



( run in 1.409 second using v1.01-cache-2.11-cpan-bbc515a03b3 )