Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl
Commits
aeb6dd59
Commit
aeb6dd59
authored
Apr 06, 2010
by
Gautier Koscielny
Browse files
Option output_file|o added to store the GFF output stream in a specific file.
parent
672ce2c5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
114 additions
and
99 deletions
+114
-99
misc-scripts/alternative_splicing/Fetch_gff.pl
misc-scripts/alternative_splicing/Fetch_gff.pl
+114
-99
No files found.
misc-scripts/alternative_splicing/Fetch_gff.pl
View file @
aeb6dd59
...
...
@@ -30,7 +30,7 @@
=head1 SYNOPSIS
Fetch_gff.pl -dbhost host -dbuser ensro -dbname homo_sapiens_core_5
7_37b
Fetch_gff.pl -dbhost host -dbuser ensro -dbname homo_sapiens_core_5
8_37c -output_file homo_sapiens_core_58_37c_variants.gff
=head1 DESCRIPTION
...
...
@@ -39,7 +39,7 @@ from an Ensembl core database.
here is an example commandline
./Fetch_gff.pl -dbhost host -dbuser user -dbname my_db -dbpass ****
./Fetch_gff.pl -dbhost host -dbuser user -dbname my_db -dbpass ****
-output_file transcript_variants.gff
=head1 OPTIONS
...
...
@@ -48,6 +48,7 @@ here is an example commandline
-dbuser what username to connect as (dbuser= in locator)
-dbpass what password to use (dbpass= in locator)
-chr which chromosome (optional)
-output_file|-o where the GFF output is written (optional, STDOUT by default)
-help displays this documentation with PERLDOC
=cut
...
...
@@ -71,6 +72,7 @@ use Bio::EnsEMBL::Utils::Exception qw(throw warning);
my
$dbuser
=
'';
my
$dbpass
=
'';
my
$chr
=
undef
;
my
$output_file
=
undef
;
my
$help
;
my
@coord_system
;
...
...
@@ -79,22 +81,36 @@ use Bio::EnsEMBL::Utils::Exception qw(throw warning);
'
dbport:n
'
=>
\
$port
,
'
dbname:s
'
=>
\
$dbname
,
'
dbuser:s
'
=>
\
$dbuser
,
'
chr:s
'
=>
\
$chr
,
'
dbpass:s
'
=>
\
$dbpass
,
'
chr:s
'
=>
\
$chr
,
'
output_file|o=s
'
=>
\
$output_file
,
'
h|help
'
=>
\
$help
,
)
or
(
$help
=
1
);
if
(
!
$host
||
!
$dbuser
||
!
$dbname
||
!
$dbpass
){
if
(
!
$host
||
!
$dbuser
||
!
$dbname
){
print
STDERR
"
Can't get any information without database details
\n
";
print
STDERR
"
-dbhost
$host
-dbuser
$dbuser
-dbname
$dbname
"
.
"
-dbpass
$dbpass
\n
";
print
STDERR
"
-dbhost
'
$host
'
-dbuser
'
$dbuser
'
-dbname
'
$dbname
'
"
.
"
-dbpass
'
$dbpass
'
\n
";
$help
=
1
;
}
}
if
(
$help
)
{
exec
('
perldoc
',
$
0
);
}
my
$output_stream
;
if
(
defined
(
$output_file
))
{
open
(
$output_stream
,
"
>
$output_file
")
||
throw
"
Can't open '
$output_file
' file for writing
\n
";
}
else
{
$output_stream
=
\
*STDOUT
;
print
STDERR
"
Will write GFF stream to the standard output.
\n
";
}
my
$db
=
Bio::EnsEMBL::DBSQL::
DBAdaptor
->
new
(
-
dbname
=>
$dbname
,
-
host
=>
$host
,
...
...
@@ -149,10 +165,9 @@ use Bio::EnsEMBL::Utils::Exception qw(throw warning);
my
$slice
=
$exon
->
slice
->
seq_region_name
();
$exon_std
=~
s/-1/-/
;
$exon_std
=~
s/1/+/
;
print
"
$chr
\t
Ensembl
\t
exon
\t
$exon_start
\t
$exon_end
\t
.
\t
$exon_std
\t
.
\t
gene_id
\"
$gene_id
\"
; transcript_id
\"
$transcr_id
\"
; exon_id
\"
$exon_id
\"\n
"
;
print
$output_stream
"
$chr
\t
Ensembl
\t
exon
\t
$exon_start
\t
$exon_end
\t
.
\t
$exon_std
\t
.
\t
gene_id
\"
$gene_id
\"
; transcript_id
\"
$transcr_id
\"
; exon_id
\"
$exon_id
\"\n
"
;
}
}
}
exit
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment