Skip to content

Commit 39d704b

Browse files
committed
regex fix
1 parent fdd03a7 commit 39d704b

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

Visualization/prepare_visualizations.pl

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/perl
22
## Pombert Lab, Illinois Tech, 2021
33
my $name = "prepare_visualizations.pl";
4-
my $version = "0.6b";
5-
my $updated = "2022-05-01";
4+
my $version = "0.7";
5+
my $updated = "2022-05-13";
66

77
use strict;
88
use warnings;
@@ -50,7 +50,6 @@
5050
'm|match=s' => \$match_file,
5151
'p|pdb=s' => \$pdb,
5252
'r|rcsb=s@{1,}' => \@rcsb,
53-
'rlist=s' => \$rcsb_list,
5453
'k|keep' => \$keep,
5554
'o|out=s' => \$outdir,
5655
'l|log=s' => \$log_file,
@@ -75,21 +74,6 @@
7574
close LOG;
7675
}
7776

78-
## Loading data from RCSB PDB list file
79-
my %rcsb_titles;
80-
if ($rcsb_list){
81-
## Creating a database of RSCB stuctures and their descriptions; PDB 4-letter code => description
82-
open DB, "<", "$rcsb_list" or die "Can't open tab-delimited file $rcsb_list: $!\n";
83-
while (my $line = <DB>){
84-
chomp $line;
85-
my @columns = split ("\t", $line);
86-
my $pdb_locus = $columns[0];
87-
my $chain_or_title = $columns[1];
88-
my $description = $columns[2];
89-
$rcsb_titles{$pdb_locus}{$chain_or_title} = $description;
90-
}
91-
}
92-
9377
## Load predicted pdb filenames into database
9478
if ($log_file){
9579
open LOG,">>","$log_file" or die "\n[WARNING]\tUnable to access $log_file: $!\n";
@@ -149,7 +133,13 @@
149133
## Check the PDB headers for proteins that are in the selection provided
150134
if ($line =~ /^###/){
151135
my $filename = (fileparse($line))[0];
152-
($model_tag) = $filename =~ /### (\S+)\;?/;
136+
if ($aligner eq "gesamt"){
137+
($model_tag) = $filename =~ /### (\S+)\;/;
138+
}
139+
elsif ($aligner eq "foldseek"){
140+
($model_tag) = $filename =~ /### (\S+)/;
141+
}
142+
153143
}
154144
## Store the matching RCSB .ent.gz filepath under the locus tag
155145
else{
@@ -226,4 +216,4 @@ sub Check_Mand_Args{
226216
die "\n[ERROR]\tGESAMT descriptive match file not provided\n\n$usage\n\n" unless $match_file;
227217
die "\n[WARNING]\tRCSB PDB directory(s) not provided, no visualizations will be made" unless @rcsb;
228218
die "\n[ERROR]\tPredicted PDB directory not provided\n\n$usage\n\n" unless $pdb;
229-
}
219+
}

0 commit comments

Comments
 (0)