Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

# Python Bioinformatics List Operations

## Overview

This project demonstrates Python list operations using biological data examples. Lists are one of the fundamental data structures in Python that allow storing multiple values in an ordered and changeable collection.

The program uses DNA nucleotide-related data to demonstrate different list manipulation techniques including accessing elements, modifying values, adding and removing items, merging lists, searching elements, sorting, and list comprehension.

## Features

- Create and display Python lists
- Access list elements using indexing
- Perform positive and negative indexing
- Extract elements using slicing
- Search elements inside a list
- Update existing list values
- Replace multiple list elements
- Insert elements at specific positions
- Append new elements
- Extend lists with another collection
- Remove elements from lists
- Iterate through list elements
- Apply list comprehension
- Sort lists in ascending and descending order

## Technologies Used

- Python 3
- List Data Structure
- Bioinformatics Data Representation

## Bioinformatics Dataset

The project uses biological terms representing DNA nucleotides:

Adenine Thymine Cytosine Guanine


Additional biological data includes:

Personal Medicine Virus Vaccine Genome Medicine


## Python List Concepts Covered

### 1. Creating a List

A list is created using square brackets `[]`.

Example:

```python
list1 = ["Adenine", "Thymine", "Cytosine", "Guanine"]

2. Accessing List Elements

Elements can be accessed using index values.

Example:

list1[0]

Output:

Adenine

3. List Slicing

List slicing extracts a range of elements.

Example:

list1[1:3]

Negative indexing is also used:

list1[-4:-2]

4. Searching Elements

The program checks whether specific biological terms exist in the list.

Example:

"Cytosine" in list1

5. Updating List Elements

Existing values can be changed using indexes.

Example:

list1[0] = "Aminoacid"

The program also demonstrates replacing a range of elements.

list1[1:4] = ["T","C","G"]

6. Adding Elements

Insert Element

Adds an element at a specific index.

Example:

list1.insert(0,"Bioinformatics")

Append Element

Adds an element at the end of the list.

Example:

list1.append("Medicine")

Extend List

Combines two lists together.

Example:

list1.extend(list2)

7. Removing Elements

The project demonstrates different removal methods.

Remove()

Removes a specific value.

Example:

list1.remove("Virus")

Pop()

Removes an element using its index.

Example:

list1.pop(4)

8. Looping Through Lists

The program uses loops to access each element.

Example:

for x in range(len(list1)):
    print(list1[x])

9. List Comprehension

List comprehension is used to create a new list based on conditions.

Example:

newList = [x for x in list1 if 'no' in x]

This extracts elements containing the specified characters.


10. Sorting Lists

The program sorts biological terms alphabetically.

Ascending order:

list1.sort()

Descending order:

list1.sort(reverse=True)

How to Run

  1. Clone the repository:
git clone https://github.com/FathimaNufla2000/Python-Bioinformatics-List-Operations.git
  1. Navigate to the project folder:
cd Python-Bioinformatics-List-Operations
  1. Run the Python file:
python list_operations.py

Output

The program displays:

  • Original biological list
  • Accessed elements
  • Sliced elements
  • Search results
  • Updated list values
  • Inserted and appended elements
  • Extended list values
  • Removed elements
  • List comprehension results
  • Sorted lists

Learning Outcomes

Through this project, the following concepts are demonstrated:

  • Python list data structure
  • Data manipulation techniques
  • Biological data handling
  • Searching and filtering data
  • Sorting and organizing information
  • Basic computational biology programming

Author

Fathima Nufla

GitHub: https://github.com/FathimaNufla2000


License

This project is created for educational purposes and Python programming practice in bioinformatics.

About

A Python-based bioinformatics project demonstrating list data structure operations using biological data such as nucleotides and genetic information. The project covers list creation, indexing, slicing, updating, insertion, deletion, searching, extending, sorting, and list comprehension.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages