For the best experience, increase the window size or view on a laptop or desktop device
Title | ||
|---|---|---|
Loading... | ||
For the best experience, increase the window size or view on a laptop or desktop device
Title | ||
|---|---|---|
Loading... | ||
You are given a list of gene sequences. Each sequence is represented as a tuple: (name, start, end), where:
A protein is defined as one or more sequences that can be chained together so that the end index of one sequence exactly matches the start index of the next sequence. The protein’s name is formed by joining the sequence names with underscores, and its interval spans from the start of the first sequence to the end of the last sequence.
For example:
Your task is to generate all possible proteins that can be formed from the given sequences.
Example input:
sequences = [
('acG', 0, 5),
('Bf5', 0, 22),
('e5c', 5, 16),
('6a5d', 5, 17),
('7f6c', 2, 13),
('0Pf', 13, 23),
('0f5c', 0, 13),
]
Expected output:
[
('acG', 0, 5),
('Bf5', 0, 22),
('e5c', 5, 16),
('6a5d', 5, 17),
('7f6c', 2, 13),
('0Pf', 13, 23),
('0f5c', 0, 13),
('acG_e5c', 0, 16),
('acG_6a5d', 0, 17),
('7f6c_0Pf', 2, 23),
('0f5c_0Pf', 0, 23),
]
You are given a list of gene sequences. Each sequence is represented as a tuple: (name, start, end), where:
A protein is defined as one or more sequences that can be chained together so that the end index of one sequence exactly matches the start index of the next sequence. The protein’s name is formed by joining the sequence names with underscores, and its interval spans from the start of the first sequence to the end of the last sequence.
For example:
Your task is to generate all possible proteins that can be formed from the given sequences.
Example input:
sequences = [
('acG', 0, 5),
('Bf5', 0, 22),
('e5c', 5, 16),
('6a5d', 5, 17),
('7f6c', 2, 13),
('0Pf', 13, 23),
('0f5c', 0, 13),
]
Expected output:
[
('acG', 0, 5),
('Bf5', 0, 22),
('e5c', 5, 16),
('6a5d', 5, 17),
('7f6c', 2, 13),
('0Pf', 13, 23),
('0f5c', 0, 13),
('acG_e5c', 0, 16),
('acG_6a5d', 0, 17),
('7f6c_0Pf', 2, 23),
('0f5c_0Pf', 0, 23),
]
Output