Package general_functions - General pipeline functions
Contains all functions to handle configuration files used in the pipeline.
Provided functions :
create_directory
execute_reverse_complementary
exit_script
get_info_genbank
get_pos_genes
get_reverse_base
get_ratio_paired_bases
produce_result_files
produce_result_pipeline
read_fasta
read_file
sort_by_num
write_file
Exported functions :
create_directory
execute_reverse_complementary
exit_script
get_ratio_paired_bases
get_reverse_base
produce_result_files
read_fasta
read_file
sort_by_num
sort_by_pos
write_file
Create a directory.
parameters : $dir, the directory to create
returns : nothing but the directory is created.
Erase all existing files and subdirectories under the provided directory
parameters : $dir : the directory containing files to erase
returns : Nothing but all files and subdirectories are erased
The function will create the reverse complementary set for all sets provided in the paths.
parameters :
$file, the file to get the reverse complementary
$outfile, the outfile to write the complementary file
returns : nothing but the reversed file is created.
Prints an error message and exit the script
parameters : $message, the error message to print
returns : nothing but the script exited
Get information on genes, RNAs in a genbank file : positions, name, locus, product and strand.
parameters : $genbank, the genbank file
returns :
$ref_pos, the reference on the positions array
$ref_pos_name, the reference on a hash table that links positions and name
$ref_pos_locus, the reference on a hash table that links positions and locus
$ref_pos_prod, the reference on a hash table that links positions and product
$ref_pos_strand, the reference on a hash table that links positions and strand
Retrieve positions of the gene located before the pos_start and the positions of the gene located after the pos_end.
parameters :
$pos_start, the prediction starting position
$pos_end, the prediciotn ending position
$pos, the reference on array containing positions
returns :
$pos_gene_5prime, the positions of the genes located in 5'
$pos_gene_3prime, the positions of the gene located in 3'
Get the ratio paired-bases/length sequence in carnac result file for the first sequence only : the reference sequence.
parameters, $file, the carnac output file ``carnac.out'' to read
returns, the ratio paired-bases/length sequence.
Return the complementary base of the provided one.
parameters : $base, the base to get its complementary
returns : the complementary base (or N if unknown)
The function will create the result files.
parameters :
$reference_file, the reference file location
$other_files, reference on array containing other files
$mask_coding_available, masking regions step or not
$mask_cds_wanted, masking CDSs wanted
$mask_rna_wanted, masking RNAs wanted
$mask_redundancy_available, masking redundant regions step or not
$yass_available, yass alignment step or not
$blast_available, blast alignment step or not
$cg_seq_available, find conserved regions or not
$carnac_available, carnac prediction or not
$rnaz_available, RNAz prediction or no
$all, all pipeline available or not
$yass_outdir_name, the name of yass outdir
$blast_outdir_name, the name of blast outdir
$rna_predicted_outdir, the location of RNA predictions
$outdir, the outdir
$warning_file, the warning file if warning occured or ``''
$time_diff, the pipeline execution time
returns : nothing but the result files are created.
Read a fasta file and return its id and sequence.
parameters : $fasta, the fasta file to read
returns : the id and sequence or nothing if nto fasta format.
Read a file and return its content.
parameters : $file, the file to read
returns : the content of the file.
Comparison function used to sort files by their number (Files must have a name like by digits).
parameters : $a, $b representative of 2 file names
returns : 1,0 or -1 ($a > $b, $a = $b, $a < $b).
Comparison function used to sort sets by their position on the reference sequence
parameters : $a, $b representative of 2 set names
returns : 1,0 or -1
Write a content into a file.
parameters :
$content, the content to write
$file, file to write
returns : Nothing but the file is written.
Benjamin Grenier-Boley <benjamin.grenier-boley@inria.fr>