Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tibvdm committed Apr 15, 2024
1 parent 0e013e7 commit 9120f31
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions fa-compression/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,23 @@ pub fn main() {
let line = line.unwrap();
let splitted_line = line.split("\t").collect::<Vec<&str>>();

let ec: String = splitted_line[7].split(';').map(|s| format!("EC:{}", s)).collect::<Vec<String>>().join(";");
let ec = splitted_line[7];
let go = splitted_line[8];
let interpro = splitted_line[9].split(';').map(|s| format!("IPR:{}", s)).collect::<Vec<String>>().join(";");
let interpro = splitted_line[9];

let mut string = String::new();
if !ec.is_empty() {
string.push_str(&ec);
let ec_corrected = ec.split(';').map(|s| format!("EC:{}", s)).collect::<Vec<String>>().join(";");
string.push_str(&ec_corrected);
string.push(';');
}
if !go.is_empty() {
string.push_str(go);
string.push(';');
}
if !interpro.is_empty() {
string.push_str(&interpro);
let interpro_corrected = interpro.split(';').map(|s| format!("IPR:{}", s)).collect::<Vec<String>>().join(";");
string.push_str(&interpro_corrected);
string.push(';');
}
if !string.is_empty() {
Expand Down

0 comments on commit 9120f31

Please sign in to comment.