<commit_before>#!/usr/bin/env perl

use strict;
use warnings;

use Getopt::Long;
use ReseqTrack::EBiSC::IMS;

my ($IMS_user, $IMS_pass, $outfile);

GetOptions("user=s" => \$IMS_user,
    "pass=s" => \$IMS_pass,
    "outfile=s" => \$outfile,
);

die "missing credentials" if !$IMS_user || !$IMS_pass || !$outfile;

my $IMS = ReseqTrack::EBiSC::IMS->new(
  user => $IMS_user,
  pass => $IMS_pass,
);

my @outlines;
open(my $fh, '>', $outfile) or die "Could not open file '$outfile' $!";
foreach my $line (@{$IMS->find_lines->{objects}}) {
  print $fh $line->{name}, "\t", join('###', @{$line->{alternative_names}}), "\t", $line->{biosamples_id}, "\n";
}
close($fh);<commit_msg>Only utilise validated lines for lit mining<commit_after>#!/usr/bin/env perl

use strict;
use warnings;

use Getopt::Long;
use ReseqTrack::EBiSC::IMS;

my ($IMS_user, $IMS_pass, $outfile);

GetOptions("user=s" => \$IMS_user,
    "pass=s" => \$IMS_pass,
    "outfile=s" => \$outfile,
);

die "missing credentials" if !$IMS_user || !$IMS_pass || !$outfile;

my $IMS = ReseqTrack::EBiSC::IMS->new(
  user => $IMS_user,
  pass => $IMS_pass,
);

my @outlines;
open(my $fh, '>', $outfile) or die "Could not open file '$outfile' $!";
foreach my $line (@{$IMS->find_lines->{objects}}) {
  if (defined $$line{validation_status}){
    if ($$line{validation_status} eq 'Validated, visible' or $$line{validation_status} eq 'Validated, not visible'){
        print $fh $line->{name}, "\t", join('###', @{$line->{alternative_names}}), "\t", $line->{biosamples_id}, "\n";
    }
  }
}
close($fh);
{'fraction_non_alphanumeric': 0.22893890675241158, 'fraction_numerical': 0.0, 'mean_word_length': 5.007722007722008, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1365920', 'n_tokens_mistral': 645, 'n_tokens_neox': 631, 'n_words': 139}