Skip to content

As a module

Convert-Pheno core is a Perl module available at CPAN.

Usage

The module can be used within a Perl script, but it can also be utilized in scripts written in other languages, such as Python.

use Convert::Pheno;

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

# Create object
my $convert = Convert::Pheno->new(
    {
        data   => $my_pxf_json_data,
        method => 'pxf2bff'
    }
);

# Apply a method
my $data = $convert->pxf2bff;

Find here an example script.

Find here an example script.

Perl inside Python, is that even possible 😄?

Perl easily integrates with other languages and allows for embedding them into Perl code (e.g., using Inline). However, embedding Perl code into other languages is not as simple. Fortunately, the PyPerler library provides a solution for this issue.