Category : itertools

Consider the file eclip_bam_paths.txt: /groups/cgsd/alexandre/eclip/bam_inputs_akshay/10249_sample1Aligned.sortedByCoord.out.bam /groups/cgsd/alexandre/eclip/bam_inputs_akshay/10249_sample2Aligned.sortedByCoord.out.bam /groups/cgsd/alexandre/eclip/bam_inputs_akshay/10249_sample3Aligned.sortedByCoord.out.bam /groups/cgsd/alexandre/eclip/bam_inputs_akshay/10249_sample4Aligned.sortedByCoord.out.bam /groups/cgsd/alexandre/eclip/bam_inputs_akshay/10249_sample5Aligned.sortedByCoord.out.bam /groups/cgsd/alexandre/eclip/bam_inputs_akshay/10249_sample6Aligned.sortedByCoord.out.bam /groups/cgsd/alexandre/eclip/bam_inputs_akshay/10249_sample7Aligned.sortedByCoord.out.bam /groups/cgsd/alexandre/eclip/bam_inputs_akshay/10249_sample8Aligned.sortedByCoord.out.bam and the file eclip_bais_paths.txt: /groups/cgsd/alexandre/eclip/bam_inputs_akshay/10249_sample1Aligned.sortedByCoord.out.bai /groups/cgsd/alexandre/eclip/bam_inputs_akshay/10249_sample2Aligned.sortedByCoord.out.bai /groups/cgsd/alexandre/eclip/bam_inputs_akshay/10249_sample3Aligned.sortedByCoord.out.bai /groups/cgsd/alexandre/eclip/bam_inputs_akshay/10249_sample4Aligned.sortedByCoord.out.bai /groups/cgsd/alexandre/eclip/bam_inputs_akshay/10249_sample5Aligned.sortedByCoord.out.bai /groups/cgsd/alexandre/eclip/bam_inputs_akshay/10249_sample6Aligned.sortedByCoord.out.bai /groups/cgsd/alexandre/eclip/bam_inputs_akshay/10249_sample7Aligned.sortedByCoord.out.bai /groups/cgsd/alexandre/eclip/bam_inputs_akshay/10249_sample8Aligned.sortedByCoord.out.bai This code loops through both files but does not retrieve the next value in the loop: keys = [‘bam_rep_1′,’bai_rep_1′,’bam_rep_2′,’bai_rep_2’] l = [] with open(‘src/eclip_bam_paths.txt’) as bams, open(‘src/eclip_bais_paths.txt’) as bais: for bamline,bailine ..

Read more