Skip to content

Instantly share code, notes, and snippets.

@raiph

raiph/.md Secret

Created January 2, 2020 17:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raiph/cd53ef62373464aee1d4e7b8eac535d4 to your computer and use it in GitHub Desktop.
Save raiph/cd53ef62373464aee1d4e7b8eac535d4 to your computer and use it in GitHub Desktop.
con's DP examples
use JSON::Fast;
use Data::Printer:from<Perl5> 'show_tied', 0;

my %conc = from-json '{"HG00112": {
    "discordant_multiallelic_loss": 0,
    "concordant_hom_alt": 4,
    "discordant_het_to_alt": 0,
    "discordant_hom_alt_to_ref": 0,
    "discordant_hom_ref_to_alt": 0,
    "lost_site": 0,
    "concordant_het": 3,
    "discordant_multiallelic_gain": 0,
    "discordant_hom_alt_to_het": 0,
    "discordant_call_to_no_call": 0,
    "discordant_het_to_ref": 0,
    "concordant_hom_ref": 5,
    "concordant_site": 18,
    "discordant_no_call_to_call": 0,
    "concordant_no_call": 6,
    "concordant_multiallelic": 0,
    "gained_site": 0,
    "discordant_hom_ref_to_het": 0
}}';

p %conc;

Run using: Rakudo v2019.03.1 on MoarVM Inline::Perl5 0.43 Data::Printer linuxmint (18.2.Sonya)

Displays:

{
    HG00112   {
        concordant_het                 3,
        concordant_hom_alt             4,
        concordant_hom_ref             5,
        concordant_multiallelic        0,
        concordant_no_call             6,
        concordant_site                18,
        discordant_call_to_no_call     0,
        discordant_het_to_alt          0,
        discordant_het_to_ref          0,
        discordant_hom_alt_to_het      0,
        discordant_hom_alt_to_ref      0,
        discordant_hom_ref_to_alt      0,
        discordant_hom_ref_to_het      0,
        discordant_multiallelic_gain   0,
        discordant_multiallelic_loss   0,
        discordant_no_call_to_call     0,
        gained_site                    0,
        lost_site                      0
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment