Advertisement
hakonhagland

Untitled

Apr 22nd, 2019
3,642
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 1.56 KB | None | 0 0
  1. use v6;
  2. use Data::Printer:from<Perl5>;
  3. use JSON::Tiny;
  4. my $json = q:to/END/;
  5. {
  6. "HG00112": {
  7.     "discordant_multiallelic_loss": 0,
  8.     "concordant_hom_alt": 4,
  9.     "discordant_het_to_alt": 0,
  10.     "discordant_hom_alt_to_ref": 0,
  11.     "discordant_hom_ref_to_alt": 0,
  12.     "lost_site": 0,
  13.     "concordant_het": 3,
  14.     "discordant_multiallelic_gain": 0,
  15.     "discordant_hom_alt_to_het": 0,
  16.     "discordant_call_to_no_call": 0,
  17.     "discordant_het_to_ref": 0,
  18.     "concordant_hom_ref": 5,
  19.     "concordant_site": 18,
  20.     "discordant_no_call_to_call": 0,
  21.     "concordant_no_call": 6,
  22.     "concordant_multiallelic": 0,
  23.     "gained_site": 0,
  24.     "discordant_hom_ref_to_het": 0
  25. }
  26. }
  27. END
  28. my %hash = from-json($json);
  29. p %hash;
  30.  
  31. # OUTPUT:
  32.  
  33.     HG00112   {
  34.         concordant_het                 3,
  35.         concordant_hom_alt             4,
  36.         concordant_hom_ref             5,
  37.         concordant_multiallelic        0,
  38.         concordant_no_call             6,
  39.         concordant_site                18,
  40.         discordant_call_to_no_call     0,
  41.         discordant_het_to_alt          0,
  42.         discordant_het_to_ref          0,
  43.         discordant_hom_alt_to_het      0,
  44.         discordant_hom_alt_to_ref      0,
  45.         discordant_hom_ref_to_alt      0,
  46.         discordant_hom_ref_to_het      0,
  47.         discordant_multiallelic_gain   0,
  48.         discordant_multiallelic_loss   0,
  49.         discordant_no_call_to_call     0,
  50.         gained_site                    0,
  51.         lost_site                      0
  52.     } (tied to Perl6::Hash)
  53. } (tied to Perl6::Hash)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement