Skip to content

Commit

Permalink
regex fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Pombert-JF committed May 13, 2022
1 parent fdd03a7 commit 39d704b
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions Visualization/prepare_visualizations.pl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/perl
## Pombert Lab, Illinois Tech, 2021
my $name = "prepare_visualizations.pl";
my $version = "0.6b";
my $updated = "2022-05-01";
my $version = "0.7";
my $updated = "2022-05-13";

use strict;
use warnings;
Expand Down Expand Up @@ -50,7 +50,6 @@
'm|match=s' => \$match_file,
'p|pdb=s' => \$pdb,
'r|rcsb=s@{1,}' => \@rcsb,
'rlist=s' => \$rcsb_list,
'k|keep' => \$keep,
'o|out=s' => \$outdir,
'l|log=s' => \$log_file,
Expand All @@ -75,21 +74,6 @@
close LOG;
}

## Loading data from RCSB PDB list file
my %rcsb_titles;
if ($rcsb_list){
## Creating a database of RSCB stuctures and their descriptions; PDB 4-letter code => description
open DB, "<", "$rcsb_list" or die "Can't open tab-delimited file $rcsb_list: $!\n";
while (my $line = <DB>){
chomp $line;
my @columns = split ("\t", $line);
my $pdb_locus = $columns[0];
my $chain_or_title = $columns[1];
my $description = $columns[2];
$rcsb_titles{$pdb_locus}{$chain_or_title} = $description;
}
}

## Load predicted pdb filenames into database
if ($log_file){
open LOG,">>","$log_file" or die "\n[WARNING]\tUnable to access $log_file: $!\n";
Expand Down Expand Up @@ -149,7 +133,13 @@
## Check the PDB headers for proteins that are in the selection provided
if ($line =~ /^###/){
my $filename = (fileparse($line))[0];
($model_tag) = $filename =~ /### (\S+)\;?/;
if ($aligner eq "gesamt"){
($model_tag) = $filename =~ /### (\S+)\;/;
}
elsif ($aligner eq "foldseek"){
($model_tag) = $filename =~ /### (\S+)/;
}

}
## Store the matching RCSB .ent.gz filepath under the locus tag
else{
Expand Down Expand Up @@ -226,4 +216,4 @@ sub Check_Mand_Args{
die "\n[ERROR]\tGESAMT descriptive match file not provided\n\n$usage\n\n" unless $match_file;
die "\n[WARNING]\tRCSB PDB directory(s) not provided, no visualizations will be made" unless @rcsb;
die "\n[ERROR]\tPredicted PDB directory not provided\n\n$usage\n\n" unless $pdb;
}
}

0 comments on commit 39d704b

Please sign in to comment.