<commit_before>#!/software/bin/perl

=head1 NAME

transfer_annotation.pl - transfer gene annotations across assemblies

=head1 SYNOPSIS

transfer_annotation.pl [arguments]

Required arguments:

  --dbname, db_name=NAME              database name NAME
  --host, --dbhost, --db_host=HOST    database host HOST
  --port, --dbport, --db_port=PORT    database port PORT
  --user, --dbuser, --db_user=USER    database username USER
  --pass, --dbpass, --db_pass=PASS    database passwort PASS
  --assembly=ASSEMBLY                 assembly version ASSEMBLY
  --altassembly=ASSEMBLY              alternative assembly version ASSEMBLY

Optional arguments:

  --chromosomes, --chr=LIST           only process LIST chromosomes
  --altchromosomes, --altchr=LIST     supply alternative chromosome names (the two lists must agree)
  --write							  to write the changes
  --author							  author login used to lock the assemblies (must be set to write the changes)
  --ref_start                         start coordinate on reference chromosomes
  --ref_end                           end coordinate on reference chromosomes
  --alt_start                         start coordinate on alternative chromosomes
  --alt_end                           end coordinate on alternative chromosomes
  --reverse                           use the reverse mapping order (compound to assembly)
  --haplotype                         for haplotype transfer, make a copy of genes (with new stable_id)

  --conffile, --conf=FILE             read parameters from FILE
                                      (default: conf/Conversion.ini)

  --logfile, --log=FILE               log to FILE (default: *STDOUT)
  --logpath=PATH                      write logfile to PATH (default: .)
  --logappend, --log_append           append to logfile (default: truncate)

  -v, --verbose=0|1                   verbose logging (default: false)
  -i, --interactive=0|1               run script interactively (default: true)
  -n, --dry_run, --dry=0|1            don't write results to database
  -h, --help, -?                      print help (this message)

=head1 DESCRIPTION


=head1 AUTHOR

<EMAIL>

=head1 CONTACT

<EMAIL>

=cut

use strict;
use Bio::Vega::DBSQL::DBAdaptor;
use Bio::Vega::ContigLockBroker;
use Bio::Vega::Author;
use Bio::EnsEMBL::Utils::Exception qw(verbose throw warning);

use FindBin qw($Bin);
use Getopt::Long;
use Pod::Usage;
use Sys::Hostname;
use Bio::EnsEMBL::Utils::ConversionSupport;

$| = 1;

my $support = new Bio::EnsEMBL::Utils::ConversionSupport("$Bin/../../..");

# parse options
$support->parse_common_options(@_);
$support->parse_extra_options(
	'assembly=s',         'altassembly=s',
	'chromosomes|chr=s@', 'altchromosomes|altchr=s@', 'write!',
	'reverse!', 'haplotype!', 'ref_start=i', 'ref_end=i', 'alt_start=i',
	'alt_end=i', 'author=s', 'email=s'
);
$support->allowed_params( $support->get_common_params, 'assembly',
	'altassembly', 'chromosomes', 'altchromosomes', );

if ( $support->param('help') or $support->error ) {
	print STDOUT $support->error if $support->error;
	pod2usage(1);
}

$support->comma_to_list( 'chromosomes', 'altchromosomes' );

# ask user to confirm parameters to proceed
$support->confirm_params;

# get log filehandle and print heading and parameters to logfile
$support->init_log;

$support->check_required_params( 'assembly', 'altassembly' );

# database connection
my $vega_db = $support->get_database('ensembl');
bless $vega_db, "Bio::Vega::DBSQL::DBAdaptor";
my $dbh = $vega_db->dbc->db_handle;

my $assembly    = $support->param('assembly');
my $altassembly = $support->param('altassembly');<commit_msg>remove confirmation of parameters<commit_after>#!/software/bin/perl

=head1 NAME

transfer_annotation.pl - transfer gene annotations across assemblies

=head1 SYNOPSIS

transfer_annotation.pl [arguments]

Required arguments:

  --dbname, db_name=NAME              database name NAME
  --host, --dbhost, --db_host=HOST    database host HOST
  --port, --dbport, --db_port=PORT    database port PORT
  --user, --dbuser, --db_user=USER    database username USER
  --pass, --dbpass, --db_pass=PASS    database passwort PASS
  --assembly=ASSEMBLY                 assembly version ASSEMBLY
  --altassembly=ASSEMBLY              alternative assembly version ASSEMBLY

Optional arguments:

  --chromosomes, --chr=LIST           only process LIST chromosomes
  --altchromosomes, --altchr=LIST     supply alternative chromosome names (the two lists must agree)
  --write							  to write the changes
  --author							  author login used to lock the assemblies (must be set to write the changes)
  --ref_start                         start coordinate on reference chromosomes
  --ref_end                           end coordinate on reference chromosomes
  --alt_start                         start coordinate on alternative chromosomes
  --alt_end                           end coordinate on alternative chromosomes
  --reverse                           use the reverse mapping order (compound to assembly)
  --haplotype                         for haplotype transfer, make a copy of genes (with new stable_id)

  --conffile, --conf=FILE             read parameters from FILE
                                      (default: conf/Conversion.ini)

  --logfile, --log=FILE               log to FILE (default: *STDOUT)
  --logpath=PATH                      write logfile to PATH (default: .)
  --logappend, --log_append           append to logfile (default: truncate)

  -v, --verbose=0|1                   verbose logging (default: false)
  -i, --interactive=0|1               run script interactively (default: true)
  -n, --dry_run, --dry=0|1            don't write results to database
  -h, --help, -?                      print help (this message)

=head1 DESCRIPTION


=head1 AUTHOR

<EMAIL>

=head1 CONTACT

<EMAIL>

=cut

use strict;
use Bio::Vega::DBSQL::DBAdaptor;
use Bio::Vega::ContigLockBroker;
use Bio::Vega::Author;
use Bio::EnsEMBL::Utils::Exception qw(verbose throw warning);

use FindBin qw($Bin);
use Getopt::Long;
use Pod::Usage;
use Sys::Hostname;
use Bio::EnsEMBL::Utils::ConversionSupport;

$| = 1;

my $support = new Bio::EnsEMBL::Utils::ConversionSupport("$Bin/../../..");

# parse options
$support->parse_common_options(@_);
$support->parse_extra_options(
	'assembly=s',         'altassembly=s',
	'chromosomes|chr=s@', 'altchromosomes|altchr=s@', 'write!',
	'reverse!', 'haplotype!', 'ref_start=i', 'ref_end=i', 'alt_start=i',
	'alt_end=i', 'author=s', 'email=s'
);
$support->allowed_params( $support->get_common_params, 'assembly',
	'altassembly', 'chromosomes', 'altchromosomes', );

if ( $support->param('help') or $support->error ) {
	print STDOUT $support->error if $support->error;
	pod2usage(1);
}

$support->comma_to_list( 'chromosomes', 'altchromosomes' );

# get log filehandle and print heading and parameters to logfile
$support->init_log;

$support->check_required_params( 'assembly', 'altassembly' );

# database connection
my $vega_db = $support->get_database('ensembl');
bless $vega_db, "Bio::Vega::DBSQL::DBAdaptor";
my $dbh = $vega_db->dbc->db_handle;

my $assembly    = $support->param('assembly');
my $altassembly = $support->param('altassembly');
{'fraction_non_alphanumeric': 0.12477446217904233, 'fraction_numerical': 0.0038861901457321307, 'mean_word_length': 2.867954911433172, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 40, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4885083', 'n_tokens_mistral': 2302, 'n_tokens_neox': 2151, 'n_words': 604}