IGEM:Harvard/2006/Container Design 4/Python Code: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
==Modifications and Additions to Dr. Shih's Code==
The code is fairly general with the exception of the Pickle Scripts which generate lists specific to Design 4 and some hardcoded lists under Oligo Sorting
*[[IGEM:Harvard/2006/Container_Design_4/Python_Code/Full_Code_Final|Full Code - Finalized 7/11]]<br>
*[[IGEM:Harvard/2006/Container_Design_4/Python_Code/Full_Code_Final|Full Code - Finalized 7/11]]<br>
*[[IGEM:Harvard/2006/Container_Design_4/Python_Code/Split_Scaffold|Split Scaffold]]<br>
*[[IGEM:Harvard/2006/Container_Design_4/Python_Code/Split_Oligos|Oligo Splitting]]<br>
*[[IGEM:Harvard/2006/Container_Design_4/Python_Code/Split_Oligos|Oligo Splitting]]<br>
*[[IGEM:Harvard/2006/Container_Design_4/Python_Code/Add_Aptamers|Adding Aptamers]]<br>
*[[IGEM:Harvard/2006/Container_Design_4/Python_Code/Add_Aptamers|Adding Aptamers]]<br>
Line 6: Line 7:
*[[IGEM:Harvard/2006/Container_Design_4/Python_Code/Oligo_Sorting|Oligo Sorting]]<br>
*[[IGEM:Harvard/2006/Container_Design_4/Python_Code/Oligo_Sorting|Oligo Sorting]]<br>
*[[IGEM:Harvard/2006/Container_Design_4/Python_Code/Pickle_Scripts|Pickle Scripts]]<br>
*[[IGEM:Harvard/2006/Container_Design_4/Python_Code/Pickle_Scripts|Pickle Scripts]]<br>
 
*[[IGEM:Harvard/2006/Container_Design_4/Python_Code/Print_Oligo_Grid|Print Oligo Grid]]<br>
 
== Other Useful Scripts==
 
*[[IGEM:Harvard/2006/Container_Design_4/Python_Code/Split_Scaffold|Split Scaffold]]<br>
 
 
==Modifications to honeycomb_v1 scripts==
*Modifications to William's program to print each oligo number next to what tokens it represents
<pre>
oligo_num = 0
for oligo in OTP_ra:
        for token in oligo:
                print str(oligo_num) + ": ", token
        oligo_num = oligo_num + 1
</pre>
 
*Modifications to William's program to print a grid of oligo numbers completely filled in
* add this part to main (AAA or BBB)
<pre>
####
# generate and print the oligo grid
####
 
# Initialize the grid with all periods
num_strands = len(TPP_ra)
num_subzones = len(TPP_ra[0])
 
sub_token_visit_ra = ['.' for subzone_num in range(num_subzones)]
grid_ra = [sub_token_visit_ra[:] for strand_num in range(num_strands)]
       
oligo_num = 0
for oligo in OTP_ra:
        grid_ra = generate_oligo_path(oligo, oligo_num, grid_ra)
        oligo_num = oligo_num + 1
print grid_ra
       
print_all_oligos(grid_ra, num_strands, num_subzones)
 
</pre>
 
* add this part to honeycomb_pointers_v1.py
<pre>
# The idea here is to have a function that adds the numbers of one oligo path
# to the appropriate places in the big grid array. Eventually this will be printed
# in main. Also it needs to be initialized in main. Oligo_path is the path of
# one oligo, while grid_ra is the grid that is constantly being updated until
# it is printed in main. oligo_num is number that will be inputed to the grid_ra.
                       
def generate_oligo_path(oligo_path, oligo_num, grid_ra):
        num_path_tokens = len(oligo_path)
               
# Assign visits
        for path_token_num in range(num_path_tokens):
                token = oligo_path[path_token_num]
                strand = token[0]
                subzone = token[1]
                grid_ra[strand][subzone] = oligo_num
       
       
        return grid_ra
 
def print_all_oligos(grid_ra, num_strands, num_subzones):
        spacer = '  '
        for strand_num in range(num_strands):
                for subzone_num in range(num_subzones):
                        visitor_string = str(grid_ra[strand_num][subzone_num]
                        sys.stdout.write(visitor_string)
                        sys.stdout.write(spacer[:4 - len(visitor_string)])
                sys.stdout.write('\n') 
</pre>

Revision as of 09:17, 12 July 2006

Modifications and Additions to Dr. Shih's Code

The code is fairly general with the exception of the Pickle Scripts which generate lists specific to Design 4 and some hardcoded lists under Oligo Sorting

Other Useful Scripts